Skip to content

feat: add tool args #207

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

Merged
merged 2 commits into from
Oct 28, 2023
Merged

feat: add tool args #207

merged 2 commits into from
Oct 28, 2023

Conversation

gtbono
Copy link
Contributor

@gtbono gtbono commented Oct 27, 2023

Hello!

When running Flutter tests in Emacs with dart-lsp, I used the Code Lens feature to click on Test and Debug lens on top of my tests.

But for an application I was working on, I needed to pass the --no-sound-null-safety argument to the Flutter CLI when debugging my tests. To make the Test lens run, I needed to add the following configuration in my Emacs:

(setq lsp-dart-test-extra-args '("--no-sound-null-safety"))

But it didn't work for the Debug lens, in the dart-lsp codebase, I can see that the lsp-dart-test-extra-args option sends the arguments to Dart's vmAdditionalArgs, but looking in the dartcode.org website https://dartcode.org/docs/launch-configuration for debugging I needed to pass the argument to toolArgs for it to work, and there is currently no way to do it.

So this PR adds a variable (is variable the right way to call this? I'm an Emacs newbie 😅 ) called lsp-dart-dap-tool-args that can be used like this:

(setq lsp-dart-dap-tool-args ["--no-sound-null-safety"])

With this turned on, the Debug lens work with the null safety argument being passed.

This is my first contribution, so I don't know how things work, do I need to bump the changelog too?

Copy link
Member

@ericdallo ericdallo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@ericdallo ericdallo merged commit 78ab137 into emacs-lsp:master Oct 28, 2023
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.

2 participants