Sublime Forum

[Solved] [ST3] Disable auto-completion box in comments&strings

#1

The auto-complete box that pops up when writing code is very useful. However, when writing long comments or strings (especially Python docstrings) I’m not sure if it helps more than gets in the way.

Is there a way to disable the auto-complete box in certain scopes? I tried this in my settings:

"auto_complete_selector": "source, meta.tag - punctuation.definition.tag.begin",

But it doesn’t help. Is the syntax of the auto_complete_selector documented somewhere? Is there a way to disable it for certain scopes?

Thanks in advance

0 Likes

#2

Sorry for necroing, but this is still an issue. Auto-completions in strings are a pain, and as far as I know there is no way to disable them. I would like to close https://github.com/viluon/LuaExtended/issues/1
Has anyone any idea about what could be done with this? If there really is no way to disable auto-complete scope-wide, could I ask for this as a feature request?

0 Likes

Preventing unwanted auto-completion in comments
#3

The default auto_complete_selector setting is: "auto_complete_selector": "meta.tag - punctuation.definition.tag.begin, source - comment - string.quoted.double.block - string.quoted.single.block - string.unquoted.heredoc",, which won’t trigger in strings.

Maybe entries in .sublime-completions files only honor the scope specified inside those files, and ignore this setting. In which case, you will want to add - string to your scope here: https://github.com/viluon/LuaExtended/blob/master/stdlib.sublime-completions#L2

For more info on how scope selectors work, you can see this answer on SO

1 Like

#4

Thanks a lot for the reply! That’s exactly what I needed.

0 Likes