akinsho / flutter-tools.nvim

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

fix(dap): Flutter/Dart project detection improvement #292

Open m-salman-a opened 9 months ago

m-salman-a commented 9 months ago

This PR aims to fix #282 by searching for the flutter sdk dependency from the pubspec.yaml file located in the root directory. This is based on the fact that the pubspec.yaml in all flutter projects requires the flutter sdk dependency, as stated by this specification.

This is the simplest way that I can think of to differentiate between flutter or dart project, but any other suggestions are welcome 😀.

EDIT: This is still not a perfect solution as this still doesn't account for any comments that can be provided in the yaml file, but I think with this change and keeping the old behavior should be good enough for most users.