Skip to content

prefer the dart binary located in dart_sdk rather than flutter_sdk #179

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

FlafyDev
Copy link

The flutter package in nix doesn't expose the dart binary in <Flutter SDK>/bin/dart. The binary is only found in the Dart SDK (<Flutter SDK>/bin/cache/dart_sdk/bin/dart).
This PR prefers the dart binary located in the Dart SDK rather than the Flutter SDK.

Concers

This PR is ready to merge only if the dart binary is always located in the dart_sdk (which I'm pretty use is always the case, but idk).
If the dart_sdk path is found but there is no <dart_sdk>/bin/dart then the plugin would fail to get the dart binary. That's because the PR doesn't check if the dart binary exists, only if paths.dart_sdk doesn't exists then it checks paths.flutter_sdk.

@akinsho
Copy link
Collaborator

akinsho commented Aug 26, 2022

This seems potentially very risky and like it will introduce a bunch of problems for a plugin that is currently fairly stable. Can this not be solved in your config file by you just explicitly referencing where it should look for the binary. Tbh I haven't looked at all this logic in months so am defo rusty on the specifics.

@FlafyDev
Copy link
Author

This seems potentially very risky and like it will introduce a bunch of problems for a plugin that is currently fairly stable. Can this not be solved in your config file by you just explicitly referencing where it should look for the binary. Tbh I haven't looked at all this logic in months so am defo rusty on the specifics.

I could've just changed my Neovim config. But I wanted my Neovim to pick the Dart binary that is associated with the Flutter that is currently in PATH (because different projects have different flutter versions). Setting the location of the Dart binary in the Neovim config wont let me do it..

@FlafyDev FlafyDev marked this pull request as draft September 9, 2022 12:23
@moonlitknight
Copy link

Just a thought, could you use the flutter_lookup_cmd = nil, -- example "dirname $(which flutter)" or "asdf where flutter" configuration option to do what you're looking for. This could reference a small script in which you can stat for files and return the PATH which you feel is most appropriate.

@sidlatau
Copy link
Collaborator

sidlatau commented Sep 8, 2024

Closing this as there is no progress in 2 years.

@sidlatau sidlatau closed this Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants