Comments (5)
Yeah I was thinking that there could eventually be something like
local config = {
-- other config above
projects = {
['~/projects/app1'] = {
arguments = {"--flavor", "dev", "--otherThing"}
},
['~/project/app2'] = {
arguments = {"--no-sound-null-safety"}
}
}
Then whenever run is called it could look at this config and apply the arguments by checking if the lsp root matches any of the keys in projects.
I guess one thing I don't like about it is that with something like vscode or coc (which I'm not actively emulating) you tend to have a local settings file where you can set this. It means a user doesn't have to put project specific config into their dotfiles, which is a bit messy. But I also don't want to create some custom local config loading mechanism that only works for just this plugin.
Tbh with the PR I have up a user can kind of already solve this themselves using a local file they load either an exrc
or some equivalent where they just override FlutterRun
to flutter run with the arguments.
from flutter-tools.nvim.
I've just noticed there's a branch that seems to implement this, what's left? @akinsho
from flutter-tools.nvim.
@Charly6596 I actually started working on something like this since I have a project I need to pass --no-sound-null-safety
to. Tbh I don't really like the idea of globals and avoid them in all my plugins where possible.
I think it's also not a very extensible solution since you can't apply it per project. I just pushed my WIP PR and the approach there was to allow passing args to the commandline argument which a user could then map
I guess another (additional) step could be allowing a user to maybe configure args per project in the config but I'd see this as an incremental improvement rather than a necessary starting point.
from flutter-tools.nvim.
@Charly6596 my immediate use case kind of disappeared and I sort of just forgot about the branch 😅 . In terms of what's left, just testing it out a little to make sure it correctly handles the various arguments it's passed and passes them on correctly. Can you try out the branch and see if it allows you to do what you want?
from flutter-tools.nvim.
@akinsho The current solution looks like a good start to me 👍 Sure, I'm gonna try it and I'll let you know.
I also dislike globals, but it doesn't really need to be one, a local variable would do to make it "persistent" until nvim is closed.
Configuration per project sounds great. The thing is to avoid passing the args every time we need to run the app.
from flutter-tools.nvim.
Related Issues (20)
- Add herline.nvim support HOT 1
- [BUG] can't set border style
- [BUG]Could not found flutter-tools command HOT 1
- [Feature Request] More Feedback for Slow Operations
- [BUG] FlutterWidgetGuides highlight group gets overwritten on entering dart file
- [Help] lsp code formatter line width HOT 1
- [Help] How to debug example project of a library HOT 5
- [BUG] Invalid line number
- [ISSUE] FlutterDevices Slow to Open HOT 1
- Not a issue- Just a thank you
- Feature: adding build runner command HOT 3
- [BUG] renaming file with _test.dart
- How do I open a Widget Inspector? HOT 1
- [FR] Ability to set DEV LOG position HOT 1
- [Help] How do i enable highlight in Outline Window?
- [BUG] fvm not working on windows HOT 2
- Neovim LSP autocompletes everything twice when working with Flutter(dart) HOT 1
- [BUG] flutter-tools in Lazy.nvim HOT 3
- [BUG] lsp code actions not loading in nvim 0.10
- lsp-dart vs flutter-tools HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flutter-tools.nvim.