-
-
Notifications
You must be signed in to change notification settings - Fork 914
Add the ability to run elixir tests from test lenses #2407
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
Conversation
clients/lsp-elixir.el
Outdated
|
||
(defun lsp-elixir--build-test-command (argument) | ||
"Builds the test command from the ARGUMENT." | ||
(let ((test-name (gethash "testName" argument)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using gethash is not allowed. All the access to the data structures that come from the language server should happen either by defined lsp-interface
or by using lsp-get
. This will allow us to migrate to using plists instead of hashtables. You may refer to rust-analyzer for example: https://github.com/yyoncho/lsp-mode/blob/headerline-errors/lsp-protocol.el#L278
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, will have a look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yyoncho I changed to lsp-get, but will figure out how lsp-interface works tomorrow if it might be a better fit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lsp-get
is good enough for non-core components given the fact that this structure will be accessed only in a few places.
As a side note, most likely vscode supports running the tests in the debugger, right? We can implement that as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean dap-mode? I have not really worked with it before, but can have a look. Ideally i would not want to click to run tests, but this is the baseline work for future capabilities it seems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean dap-mode?
yes.
Ideally i would not want to click to run tests, but this is the baseline work for future capabilities it seems.
There is lsp-avy-lens
. And then you will be able to re-run with M-x recompile
.
Thank you for contributing to |
Tests running code lenses are now provided by elixir-lsp elixir-lsp/elixir-ls#389 and implemented for vscode elixir-lsp/vscode-elixir-ls#155.
This adds the ability to switch on elixir test lenses and will run the tests using the compile function.