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

The auto complete triggers are way too aggressive #114

Closed
FichteFoll opened this issue Aug 23, 2022 · 7 comments
Closed

The auto complete triggers are way too aggressive #114

FichteFoll opened this issue Aug 23, 2022 · 7 comments

Comments

@FichteFoll
Copy link

FichteFoll commented Aug 23, 2022

With volar, the AC popup opens way too frequently, most notably after inserting a comma. I noticed that the following gets added to my auto_complete_triggers setting:

{'characters': '!@#$%^&*()_+-=`~{}|[]:";\'<>?,./ ', 'selector': 'source - comment - string, meta.tag - punctuation.definition.tag.begin', 'server': 'LSP-volar'}

(https://github.com/johnsoncodehk/volar/blob/b3b30931080b3f377e8f33dbb4808fe216c7763a/packages/vue-language-server/src/registers/registerlanguageFeatures.ts#L59-L59)

I really only want to have auto completion after a period, so basically what the default settings already do via {"selector": "punctuation.accessor", "rhs_empty": true}.

I adopted the following section from the LSP-json plugin locally for me:

https://github.com/sublimelsp/LSP-json/blob/a65342f9908b0a759c148a574815d20811201b06/LSP-json.sublime-settings#L16-L21

@FichteFoll FichteFoll changed the title The auto complete triggers are way too agressive The auto complete triggers are way too aggressive Aug 23, 2022
@rchl
Copy link
Member

rchl commented Aug 23, 2022

It doesn't seem like VSCode triggers completions on comma, for example, even when the server returns same trigger characters.

@johnsoncodehk do you know why this wouldn't affect VSCode and why such choice of trigger characters?

@johnsoncodehk
Copy link
Contributor

johnsoncodehk commented Aug 27, 2022

All valid trigger character is collect from embedded language service plugin, but it cannot know at register language server features in advance, so vue language server config all characters and divert trigger character completion request itself.

If this causes problems, I can hardcode remove characters such as ',' for now.

@rchl
Copy link
Member

rchl commented Aug 27, 2022

If those trigger characters do nothing for VSCode (not sure what is its logic) and causes problems in other editors then removing would make sense IMO.

johnsoncodehk added a commit to vuejs/language-tools that referenced this issue Aug 28, 2022
@johnsoncodehk
Copy link
Contributor

johnsoncodehk commented Aug 29, 2022

Please try @volar/vue-language-server v0.40.4.

@rchl
Copy link
Member

rchl commented Aug 29, 2022

@FichteFoll
Copy link
Author

Fix confirmed.

There still appears to be a rather large set of completion triggers (like ()[]-), but I wasn't able to get them to misbehave in contexts where I wouldn't expect completions to show.

@johnsoncodehk
Copy link
Contributor

You can config initializationOptions.languageFeatures.completion.ignoreTriggerCharacters to filter completion trigger characters that you don't wanted with v0.40.7.

predragnikolic added a commit that referenced this issue Sep 5, 2022
* bump server

* remove experimentalImplicitWrapComponentOptionsWithDefineComponent and experimentalImplicitWrapComponentOptionsWithVue2Extend
in favor of experimentalComponentOptionsWrapper and experimentalComponentOptionsWrapperEnable

* add volar.vueserver.textDocumentSync client glue

* add initialization options properties to sublime-packages.json

* add client volar.ignoreTriggerCharacters setting

ref #114 (comment)

* volar.vueserver.textDocumentSync order
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

No branches or pull requests

3 participants