A frontend-independent IDE "smartness" server for Elixir. Implements the "Language Server Protocol" standard and provides debugger support via the "Debug Adapter Protocol"
Started ElixirLS v0.13.0
ElixirLS built with elixir "1.12.3" on OTP "22"
Running on elixir "1.14.3 (compiled with Erlang/OTP 25)" on OTP "25"
Operating system: MacOS 11.7.3
Editor or IDE name (e.g. Emacs/VSCode): Emacs
Editor Plugin/LSP Client name and version: lsp-mode 20230221.1558
Current behavior
When inserting a completion candidate for a function, an opening parenthesis gets inserted after the function name.
Example: Typing IO.p gets completed to IO.puts( (note the open parenthesis at the end).
This is undesirable for me, since I use the smartparens package in Emacs, and I have smartparens-strict-mode turned on for all programming languages. smartparens-strict-mode means it is impossible for the user to create unbalanced parentheses, quotes, etc. by typing or deleting text.
Ironically, it means that in the case of the above example (IO.puts(), I am not able to insert the closing ), since smartparens detects that this would lead to unbalanced parentheses. Same holds for deleting the orphaned (.
Thus, with smartparens-strict-mode, the described completion behaviour leaves the code buffer in a deadlock state (not possible to insert or delete any further parentheses).
Expected behavior
It would be great if there were a server option to set from the client, which, when turned on, would make sure that any paired delimiters (parentheses, quotes, etc.) would only ever be inserted in matching pairs when completing code.
This new option could be off by default, so as to preserve the current behaviour, and make it a backwards compatible change.
The documentation for the new option might even choose to make a reference to the smartparens package for Emacs, and its smartparens-strict-mode.
Environment
MacOS 11.7.3
Emacs
lsp-mode 20230221.1558
Current behavior
When inserting a completion candidate for a function, an opening parenthesis gets inserted after the function name.
Example: Typing
IO.p
gets completed toIO.puts(
(note the open parenthesis at the end).This is undesirable for me, since I use the smartparens package in Emacs, and I have
smartparens-strict-mode
turned on for all programming languages.smartparens-strict-mode
means it is impossible for the user to create unbalanced parentheses, quotes, etc. by typing or deleting text.Ironically, it means that in the case of the above example (
IO.puts(
), I am not able to insert the closing)
, since smartparens detects that this would lead to unbalanced parentheses. Same holds for deleting the orphaned(
.Thus, with
smartparens-strict-mode
, the described completion behaviour leaves the code buffer in a deadlock state (not possible to insert or delete any further parentheses).Expected behavior
It would be great if there were a server option to set from the client, which, when turned on, would make sure that any paired delimiters (parentheses, quotes, etc.) would only ever be inserted in matching pairs when completing code.
This new option could be off by default, so as to preserve the current behaviour, and make it a backwards compatible change.
The documentation for the new option might even choose to make a reference to the smartparens package for Emacs, and its
smartparens-strict-mode
.