erlang-ls/erlang_ls

Auto-fill simple case patterns

tatut opened this issue · 0 comments

tatut commented

Describe the solution you'd like
Autocompletion is good, but many functions have simple patterns that you want to match.
erlang_ls could automatically (or with some keybinding or hint) suggest to fill the pattern.

For example:

If I have code case orddict:find(Key, Dict) of
I woulf like to automatically fill it out to:

case orddict:find(Key, Dict) of
    {ok, Value} -> #; 
    error -> implement
end

where # marks where to place the cursor.

I don't know if this is in scope, so feel free to reject.
Just had the idea that many simple patterns could be automatically filled in.
The type information is already present.

Describe alternatives you've considered
Using Emacs so this could probably be done with tree-sitter query and some custom elisp to get the information from lsp.