Giter Site home page Giter Site logo

Comments (5)

akinsho avatar akinsho commented on May 27, 2024 1

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.

Charly6596 avatar Charly6596 commented on May 27, 2024

I've just noticed there's a branch that seems to implement this, what's left? @akinsho

from flutter-tools.nvim.

akinsho avatar akinsho commented on May 27, 2024

@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.

akinsho avatar akinsho commented on May 27, 2024

@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.

Charly6596 avatar Charly6596 commented on May 27, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.