-
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
New server configuration key: auto_complete_selector #1408
Conversation
The auto_complete_selector is used to fine-tune the behavior of the AC popping up. This selector is added to an entry of the "auto_complete_triggers" of the view, alongside the trigger characters advertised by the language server. When both the selector and at least one trigger matches, the AC is shown. Note that we have to notify all SessionViews of new capability registrations, so that they can update their trigger chars.
Trying it out on default preferences.
Isn't it supposed to prevent completions popping up within a string? |
That is an escaped character, which I didn't account for in the selector. In order to not trigger AC even for backslash-escaped double-quotes, we should use
which I will update in the PR for LSP-json. |
What about the colon (also pictured in my gif)? |
Oh, I didn't notice that one :) that cannot be fixed because the |
This is not how I've imagined the fix would work. I thought that we can just plain prevent completion from triggering for those two characters ( |
There are a couple options here.
I would personally go for only an extra boolean to disable trigger characters, as the other options get out of hand with respect to configuration options. What do you think? The interaction between a server's trigger chars, an ST syntax, and ST's default auto_complete_selector seems to work out okay. For instance,
In almost all of these programming languages a trigger char would not be allowed to be part of a range normally used for identifiers. The exception here is the JSON syntax which may contain trigger chars in strings (where, also somewhat irregular, we do want to allow auto-complete). |
I'll play with it a bit more, maybe it's good enough, but option 1 would allow us to disable colon in scopes like strings so it does sound better. But maybe it's not worth the complexity. |
Could we make it so that Looking at the |
I went with a boolean to disable the triggers from the server.
|
The auto_complete_selector is used to fine-tune the behavior of the AC popping
up. This selector is added to an entry of the "auto_complete_triggers" of the
view, alongside the trigger characters advertised by the language server.
When both the selector and at least one trigger matches, the AC is shown.
Note that we have to notify all SessionViews of new capability registrations,
so that they can update their trigger chars.
Resolves #933