erlang_ls
erlang_ls copied to clipboard
using the add'_' to Variable causes duplication of the clause
Describe the bug
some(Variable) -> ok.
and using the code action on Variable resutls in
some(_Variable) -> ok.
some(Variable) -> ok.
instead of just
some(_Variable) -> ok.
Context
-
erlang_ls
version (tag/sha): 0.18.0 - Editor used: VSCode
@TheGeorge I cannot reproduce this with the latest HEAD
. Tried both Emacs and VS Code. Do you mind adding a test case showing this issue? Maybe it's a corner case which only gets triggered under certain conditions?
Ping @TheGeorge
I totally missed this, let me check if this is still broken
I totally missed this, let me check if this is still broken
It was broken as of yesterday.
@robertoaloi This reproduces the error for me
-module(unused).
-export[hello/1].
hello() ->
Wow = 8,
"Hello World".
I'm using latest HEAD
and VS Code
From what I can tell the issue might be related to the range, in my case the start and end line received by els_code_action_provider:handle_request
are the same (5
) so according to a note in replace_lines_action
that would add the line instead of replacing it.
I tested modifying the generated command to have EndLine+1
and it solved the issue, but wondering why you couldn't replicate it and if there is something else going on
Can confirm in Sublime Text 4 (4127) and Sublime LSP v1.15.0.
Fixed