elixir-lsp / vscode-elixir-ls

Elixir language support and debugger for VS Code, powered by ElixirLS.
https://marketplace.visualstudio.com/items?itemName=JakeBecker.elixir-ls
MIT License
545 stars 105 forks source link

Hit return on "handle_call" completion insert extra "do" and "end" #405

Closed CharlesIrvineKC closed 10 months ago

CharlesIrvineKC commented 10 months ago

In a GenServer module with initial contents:

1

I type "def" and get: 2

If I then hit return I get: 3

Now, if I then type "handle", I get: 4

If I hit return on the first completion "handle_call", I get an extra do-end pair in my edit buffer, which will be a syntax error. 5

Is this a bug, or is there something that I'm not doing right?

Thanks

CharlesIrvineKC commented 10 months ago

To make this easier to reproduce, I'm attaching a mix project zip file:

queues.zip

Open the uncompressed zip file in vscode and in the file simple_file.ex, place your cursor as shown here:

screen_shot

With you cursor placed as shown, type "handle" and you should see the completions:

completions

Now, simple hit the return key and you should see the extra do-end pair.

extra_pair

CharlesIrvineKC commented 10 months ago

I realize now that I wasn't choosing the correct snippet. I should have and am now using the snippet for defining a handle_call function definition. My issue seems like a user error. Closing issue.