Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-fill simple case patterns #1415

Open
tatut opened this issue Dec 15, 2022 · 0 comments
Open

Auto-fill simple case patterns #1415

tatut opened this issue Dec 15, 2022 · 0 comments
Labels
contribution welcome The authors do not have expertise on this, so external contributions are welcome feature

Comments

@tatut
Copy link

tatut commented Dec 15, 2022

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.

@plux plux added feature contribution welcome The authors do not have expertise on this, so external contributions are welcome labels Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution welcome The authors do not have expertise on this, so external contributions are welcome feature
Projects
None yet
Development

No branches or pull requests

2 participants