VS Code autocomplete does not work with return
Been digging into Elixir for the first time over the weekend and noticed a UX issue with the autocomplete.
When confirming a selection with return, VS Code creates a new-line in the code rather than injecting the selected suggestion.
This does not happen when confirming the selection with tab. Also compared observation with other languages like JavaScript and Python, and all work with both return and tab.
Environment
- Elixir & Erlang versions (elixir --version):
Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
Elixir 1.6.4 (compiled with OTP 20)
- Operating system:
macOS High Siera 10.13.3 - Client (editor or IDE):
VSCode 1.22.1
-
If using a client other than VS Code, please try VS Code's ElixirLS extension. Does it reproduce your failure? NA - this is a UX issue with the VS Code integration
-
Create a new Mix project with
mix new empty, then open that project with VS Code and open an Elixir file. Is your issue reproducible on the empty project? If not, please publish a repo on Github that does reproduce it. Am able to reproduce in an empty project. https://github.com/joshua-andrassy/empty-elixir-project -
Check the output log by opening
View > Outputand selecting "ElixirLS" in the dropdown. Please include any output that looks relevant. (If ElixirLS isn't in the dropdown, the server failed to launch.) Don't see any output generated while reproducing the issue. -
Check the developer console by opening
Help > Toggle Developer Toolsand include any errors that look relevant. Don't see any errors while reproducing the issue.
This is deliberate and explained in the readme: https://github.com/JakeBecker/vscode-elixir-ls#default-settings . You can change it in your settings file if you like.
I had the same issue and now it's working well
make sure to add this following to vscode settings.json file
"[elixir]": {
"editor.acceptSuggestionOnEnter": "on"
},
even if you have this option enabled globally specify it to elixir Once More and it will work