I’ve been using Sublime Text for a very long time now, and for the first time I actually want to turn on autocompletion suggestions that are being populated via the LSP plugin. I want them in one situation and one situation only, which is where I am typing a member accessor, i.e. something.member
. This is with ST4 build 4126 currently. Which I’m aware is a bit out of date, but I don’t see anything clearly related to this in the release changelog since then. (And I am hesitant to update on this machine because I am getting frequent crashes when reordering tabs on the latest build 4169 on another machine.)
This is what my sublime-settings
currently look like for the GDScript language, which I have a LSP running for and configured for use with the ST LSP plugin:
"auto_complete": true,
"auto_complete_delay": 500,
"auto_complete_trailing_spaces": false,
"auto_complete_use_index": false,
"auto_complete_selector": "punctuation.accessor - comment - string, variable.other.member - comment - string",
This seems to be mostly working, except that the autocompletion popup is showing up when I type a period .
within comments or string literals.
Here’s screenshots showing what I mean, where this occurs both in the middle of a line and at the end of one:
I am using a sublime-syntax
file that I adapted from a plugin, so my first thought was that I made a mistake in the scopes there. But I can verify that the scopes are correct, and not any of those given in the auto_complete_selector
setting via Tools > Developer > Show Scope Name.
Here’s the relevant parts of my sublime-syntax
file:
- match: \b({{identifier}})(?:(\.)({{identifier}})?)*
captures:
1: variable.other.gdscript
2: punctuation.accessor.gdscript
3: variable.other.member.gdscript
- match: (##).*$
scope: comment.line.documentation.gdscript
captures:
1: punctuation.definition.comment.number-sign.gdscript
- match: (#).*$
scope: comment.line.number-sign.gdscript
captures:
1: punctuation.definition.comment.number-sign.gdscript
What’s going on with this? How can I make the autocompletion popup stop showing up in comments and strings? Why is it showing up in scopes that aren’t included in the selector in the first place?