Sublime Forum

Disable auto complete from comments

#1

tldr: I want to be able to tell the indexer which words to index by scope and where those indexed words can be used.

Often times when I am typing the code, the auto complete is suggesting words from comments, for example:

let myVar = 1
// some comment
[press ctrl space]

This would show the words

some
1
myVar
let

in the list of suggested words, it is mixing variable declarations, literals and comments in the suggestions. Is it possible to separate it? I mean

  • Words indexed from comments, be auto completed in the comments only;
  • In the source, only variable/classes/function declarations (entity.name… not variable.other…) appear in the suggestion;
0 Likes

#2

Such fine grained completions can only be handled by a plugin. You can define an event listener with on_query_completions hook. Within that hook, you can check for the scopes of the current caret positions and then provide the completions you want, using e.g. find_by_selector and extracting words from that.

1 Like