Sublime Forum

Auto complete, how to clear it and 'reload'

#1

Greetings !

The auto-complete ‘buffer’ (sorry don’t know the correct technical lingo, it’s the thing that suggests snippets, auto complete, one usually presses tab or enter) unfortunately remembers my spelling mistakes, so for example:

int split = 0;
spilt +=5;

spilt is a typo, but both appear in the ‘buffer’ so i keep making the mistake, reinforcing the buffer.

I had a look at this, but it’s largely indecipherable to me

Needless to say if there’s a solution that doesn’t involve a masters in Python or an ST3 course I’d be very grateful. I just seem to be able to find all the awkward bits of ST3, it seems to be a gift.
Except for the answer that was just press the tab key ! Ha ha !

Thanks again Lazmondi

(see what I did there ! I should leave off the ‘funnies’)

0 Likes

#2

I don’t think there is a way for you to have a “spell check” in auto completion to the best of my knowledge. After all, all the variables in the current buffer (or those that have the variable scope) are a part of the auto complete namespace & it has no knowledge about what mistakes you make since variables can be named anything (within reason) and might not be proper english words at all.

0 Likes

#3

I would double check that you don’t have another instance of the misspelled word somewhere in your file. The autocomplete should only be offering you completions sourced from snippets, completion files, plugins and words in your buffer. In this case the source would be your buffer.

0 Likes

#4

@UltraInstinct05 I’m sorry but that’s not what I’m asking for at all.
I just want to clear the buffer and ‘re-instate it’ as it were, once i’ve sorted out my typos , then hopefully it’ll only have ‘the good’ spellings of my variable names too.
Also if I don’t use a variable name anymore, it still comes up in the options, that list getting more and more cluttered. Hopefully I’ve cleared the muddy waters a bit !

:grinning:

0 Likes

#5

@OdatNurd

Unfortunately that’s not the case, even if a variable name isn’t being used in any of the files any more, it still crops up in the auto complete list… Once created, always there !

Any solutions folks ?

0 Likes

#6

What you’re looking for is a linter that puts a squiggly red line under “spilt”. Packages that do this kind of stuff include SublimeLinter or LSP.

0 Likes

#7

Thank you, but that still isn’t what I’m after.
Does no-one else’s version of ST3 do what I’m describing ?
What about old variables not in use any more, they still show up in the auto complete box, unfortunately. Maybe I have to close and reload everything. Ah ha, I’ll try that and get back…

0 Likes

#8

So I’m guessing there’s no way to clear that buffer ?

0 Likes

#9

I’ve never personally experienced the autocompletion system doing what you describe, no; it only offers suggestions for what it sees now, not what it’s seen in the past.

That said there are a myriad of packages for augmenting completions (like lsp and such) and I’ve never installed anything like that either. So if you’ve installed anything of that sort, or even something that has that as an additional feature might be to blame.

This is a situation in which I’d recommend trying to revert to a fresh state to see if the problem persists or not.

0 Likes

#10

No I don’t have anything exotic installed at all. Ok, thank you !

0 Likes

#11

Ah ha said Abba. Good news and bad news, good news for ST3 and bad news ish for me.

I had the same behaviour again, and this time, bearing everything that’s been said said, decided to look for the wrong spelling to see if it occurred in the file.

And indeed it did, in a comment, which was why ST3 was remembering it. Have changed all the comments and the “misspelling” has indeed disappeared.

So there’s my mistake, for anyone else, if your “misspellings”/old variable names are still present, check the comments it only takes one. So my Bad, thanks to all.

So the answer seems to be:

  1. No you can’t clear the auto complete buffer.
  2. Check the entirety of your file for misspellings/incorrect naming’s coz they will be retained. To be fair @OdatNurd nailed it earlier…

Thanks to all who replied, sorry for wasting folks time there…

0 Likes