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

Infer default @spec when completing above an existing def/defp #797

Closed
zachallaun opened this issue Jul 23, 2024 · 1 comment
Closed

Infer default @spec when completing above an existing def/defp #797

zachallaun opened this issue Jul 23, 2024 · 1 comment
Labels
completions Enhancements to Lexical's autocompleter enhancement New feature or request good first issue Good for newcomers

Comments

@zachallaun
Copy link
Collaborator

This is essentially the inverse of #787.

The following:

@sp|
def my_function(arg) do
  ...
end

Completes to:

@spec
def my_function(arg) do
  ...
end

If the completion is immediately before a def, the function name and arity could be inferred:

@spec my_function(term()) :: term()
def my_function(arg) do

end
@zachallaun zachallaun added enhancement New feature or request good first issue Good for newcomers completions Enhancements to Lexical's autocompleter labels Jul 23, 2024
zachallaun added a commit that referenced this issue Jul 25, 2024
@scohen
Copy link
Collaborator

scohen commented Jul 26, 2024

You can also infer the arg names

@spec my_function(arg :: term()) :: term

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completions Enhancements to Lexical's autocompleter enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants