Sublime Forum

Baffling truncated choices in completion menu


I did the Emacs Pro Essentials plugin for ST3. I created my own completion handler which searched all the open buffers for substrings of what you’re typing. What I wanted was to be able to complete on all the symbols of the project in addition to substrings, but at the time there was no access to the symbols for the purposes of completion.

I knew St4 had support for that but my plugin was preventing that from working. So I turned it off. And in general I like it a LOT. But sometimes I get truly bizarre behavior.

E.g., 02

I do have, in separate classes in the current coffeescript file, getUser, getName, getShift, getRota, getGrade, etc., but for some reason ST4 is truncating the last letter. But not always …

Here I typed some more:


More of the same.

I also noticed that sometimes I add a new method, but then I cannot perform a completion on it. It’s just not found. But it’s definitely a known function because I can “goto symbol” and that works.

Are these known issues?

Also, I think what I’d like is to be able to complete on symbols within the entire project as well as substrings in the existing buffers. When my on_query_completions method was still in use (now it’s commented out) I was returning the following:

     return (words, sublime.INHIBIT_WORD_COMPLETIONS)

and I am wondering if that flag prevents the symbol completion from working?

Also are WORD_COMPLETIONS part of the current buffer only or all buffers?

Hope someone can help. Sorry for the involved question.



Does it happen in safe mode?



Wow - no


OK … um … I disabled emacs pro essentials so I guess I just need to disable all plugins one at a time to find the one which is messing with me?



It seems to be the ‘Better CoffeeScript’ plugin that is doing it.


Any ideas how a plugin can strip the last letter off completions that are provided by the system?



It’s likely that the syntax definition scopes the last character differently so it’s not part of the symbol and thus excluded from auto-complete.



Thanks for your help.

Another question: What is the meaning of Literate in syntax versions? Coffeescript and others have regular and literate modes. The completion works fine in literate mode but the overall behavior is quite different.

Oh OK - I googled it :slight_smile: Never mind.



Wow - look at that!

The last letter is part of a different group not mentioned in the syntax file.

Actually, group 3 is mentioned:

Is it possible that ST4 doesn’t like the two captures representing a single array of text?

This fixed it without any obvious bad side-effects so far:




The 3rd capture group is inside the 2nd, so the scope for the last character is different and thus can’t be part of the same symbol.



Even though the scope name is the same?

Do you think my change was right? It’s as though the author thought it was necessary for some reason. Am I going to be disappointed with my change eventually?



Even though the scope name is the same?

It applies the same scope, but on top of the other. The symbol would be scopes as but the last character, which is obviously different.

Your change seems fine, but ideally it would make it into the package itself.



Package hasn’t been touched in 9 years I think.

Might try a pull request just in case …