Skip to content

feat(postfix): add templates #944

New issue

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

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

Already on GitHub? # to your account

Merged
merged 1 commit into from
Feb 8, 2022
Merged

Conversation

kevinhwang91
Copy link
Contributor

@kevinhwang91 kevinhwang91 commented Feb 6, 2022

Postfix is extremely useful, but we should reduce its priority to avoid
missing the expected candidates during completing.

In the language server like gopls, which supports var to
assign variable and range to iterate collection, we should add
these templates for postfix in Lua as well.

@kevinhwang91
Copy link
Contributor Author

The tests all failed because of the lower priority of postfix. I'm not sure you agree with my mind, waiting for your reply.

@sumneko
Copy link
Collaborator

sumneko commented Feb 8, 2022

image

If reduces its priority, it looks messy.

@sumneko
Copy link
Collaborator

sumneko commented Feb 8, 2022

The added templates looks nice.

@kevinhwang91
Copy link
Contributor Author

image

If reduces its priority, it looks messy.

I have forgot that the trigger char for postfix has been changed to . by myself.
Have you tried the gopls with its postfix? The postfix snippet is triggered by . and its priority is lower than others like members of a struct.
In Lua language server, if I have typed table.in, and then accept the insert of the postfix template, the TextEdit will become table.insert(table, |) that is annoyed me a lot.

@sumneko
Copy link
Collaborator

sumneko commented Feb 8, 2022

I have reduce the priority by this commit: 8623701

You may open a separate PR for adding the templates.

In the language server like gopls, which supports `var` to
assign variable and `range` to iterate collection, we should add
these templates for postfix in Lua as well.
@kevinhwang91 kevinhwang91 changed the title feat(postfix): reduce its priority and add templates feat(postfix): add templates Feb 8, 2022
@kevinhwang91
Copy link
Contributor Author

force push now.

@sumneko sumneko merged commit fb3b060 into LuaLS:master Feb 8, 2022
@sumneko
Copy link
Collaborator

sumneko commented Feb 8, 2022

Thank you!

@kevinhwang91 kevinhwang91 deleted the improve-postfix branch February 8, 2022 15:16
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants