akinsho / flutter-tools.nvim

Tools to help create flutter apps in neovim using the native lsp
MIT License
932 stars 75 forks source link

add flutter dependency detection #326

Closed mikeborodin closed 5 months ago

mikeborodin commented 5 months ago

Flutter dependency detection

As mentioned in https://github.com/akinsho/flutter-tools.nvim/issues/282 the we need a better way to detect which configs to use - Dart or Flutter. This PR intents to do that by matching the consequent lines in pubspec.yaml

Test cases I checked:

akinsho commented 5 months ago

@sidlatau thoughts? I haven't really worked with any non flutter dart projects

sidlatau commented 5 months ago

@sidlatau thoughts? I haven't really worked with any non flutter dart projects

LGTM. We already have PR with similar logic https://github.com/akinsho/flutter-tools.nvim/pull/292/files - but it is easier to understand regex here than in mentioned PR. Not sure which one is more performant and if that matters here.

mikeborodin commented 5 months ago

@sidlatau thoughts? I haven't really worked with any non flutter dart projects

LGTM. We already have PR with similar logic https://github.com/akinsho/flutter-tools.nvim/pull/292/files - but it is easier to understand regex here than in mentioned PR. Not sure which one is more performant and if that matters here.

Yes I saw that one but seems like there was no progress in some time and in my approach I intentionally don't keep the previous behavior.

akinsho commented 5 months ago

I imagine there might be some performance cost from using fn.glob and also fn.readfile as generally the fn.* methods do a trip through viml so are slower but I assume this function isn't called super often 🤷🏾‍♂️ we'll see