-
Notifications
You must be signed in to change notification settings - Fork 184
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
Triggering completion leaves initial character duplicated #714
Comments
Sounds like the same issue we already fix in completions starting with ‘$’ and ‘:’ and ‘-‘. Perhaps you want to see if we can generalize the “trim leading char if not alphanumeric” logic in |
I've looked a bit but the whole logic of figuring out position to insert is quite complicated and probably easy to break for someone who doesn't have a good overview of all the quirks. From my naive understanding though, when I insert
Given that it provided range to replace (0-1) with the completion text, if LSP would follow that, I think it should work. But that information seem to be lost in the process of formatting complations. What do you think? Is it correct to assume that when |
Correct, the The fixes are here if you want to have another look: |
@rchl see also sublimehq/sublime_text#2754 |
@rchl, can you share a bit more of your config? I cannot get the vue server (0.0.61) to return its snippet completions in a totally empty .vue file.
Perhaps @predragnikolic can help? |
It's not working for me either now. Possibly because of the thing you mentioned:
Where do I have to add it exactly? |
@tomv564 I have made a fix so that snippets worked in v0.0.61 (sublimelsp/LSP-vue#6) but @predragnikolic removed it when updating to latest server version and didn't re-add it back when reverting to version v0.0.61. So with current LSP-Vue snippets won't work. You have to either wait until things stabilize or manually apply my fix (it won't apply cleanly in current code though). |
Thanks, I hardcoded a non-existing path and it started working! The LSP problem is an inconsistency in how sublime handles certain prefixes in completions. If in PHP you trigger with But when using That inconsistency broke our "find out which completion was inserted so we can fix the textEdit" logic. I added an exception so if a completion resulted in |
About the completion selector: Go into "Preferences - Settings (Syntax Specific)", override {
"auto_complete_selector": "text.html, meta.tag - punctuation.definition.tag.begin, source - comment - string.quoted.double.block - string.quoted.single.block - string.unquoted.heredoc"
}
|
Using LSP-vue on OSX, LSP v0.8.6.
This requires latest version of vue-language-server
which LSP-vue at the current time doesn't use. So manual upgrade of bundled vue-language-server is needed.It's now up to date.Repro
<
to trigger completions (snippets)Expected
Snippet is inserted properly
Actual
The
<
character is duplicated at the beginning. So basically trigger character wasn't replaced with snippet content.Screenshots:
Logs
Type
<
to trigger completions:Pick completion with
tab
:The text was updated successfully, but these errors were encountered: