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

Remove function argument snippets if snippets unsupported #223

Merged
merged 1 commit into from
Apr 28, 2020

Conversation

jeffrey-xiao
Copy link
Contributor

@jeffrey-xiao jeffrey-xiao commented Apr 26, 2020

Prior to this change, function completion always filled in function arguments with snippets. If snippets are not supported by the client, do not fill in any arguments, but only complete the name of the function.

Additionally, tweak the snippet regex to recognize ${1:arg1} as a snippet.

Fixes #207.

@jeffrey-xiao jeffrey-xiao marked this pull request as draft April 26, 2020 03:50
@jeffrey-xiao jeffrey-xiao force-pushed the fix-snippets-supported branch 2 times, most recently from cabded3 to 41f8e64 Compare April 26, 2020 03:57
@jeffrey-xiao
Copy link
Contributor Author

If this approach of passing options down to snippet looks good, I'll add tests.

@jeffrey-xiao jeffrey-xiao marked this pull request as ready for review April 26, 2020 03:59
@jeffrey-xiao jeffrey-xiao force-pushed the fix-snippets-supported branch from 41f8e64 to 08520b5 Compare April 26, 2020 15:21
Copy link
Member

@axelson axelson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This approach looks good. Please add some tests and then it should be good to go!

@jeffrey-xiao jeffrey-xiao force-pushed the fix-snippets-supported branch from 08520b5 to 93c43ad Compare April 26, 2020 22:43
…#207)

Prior to this change, function completion always filled in function
arguments with snippets. If snippets are not supported by the client,
do not fill in any arguments, but only complete the name of the
function.

Additionally, tweak the snippet regex to recognize ${1:arg1} as
a snippet.
@jeffrey-xiao jeffrey-xiao force-pushed the fix-snippets-supported branch from 93c43ad to 3a9c525 Compare April 26, 2020 23:55
@jeffrey-xiao jeffrey-xiao requested a review from axelson April 28, 2020 05:24
Copy link
Member

@axelson axelson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks! ❤️

@axelson axelson merged commit f69397f into elixir-lsp:master Apr 28, 2020
axelson added a commit that referenced this pull request Apr 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Function completions always returned as snippets
2 participants