Sublime Forum

Sublime-completions overriding completions list

#1

I created a Java.sublime-completions with all the keywords, exceptions, classes and interfaces defined in java.lang

{
  "scope": "source.java",

  "completions": [
    ...
    "ArithmeticException",
    "ThreadDeath",
    ...
  ]
}

This is actually overriding my buffer completions.

If I have a buffer with

foo.addFoo();

typing .add in the buffer shows Thre**adD**eath instead of addFoo. Once I type .addF it shows addFoo. Is there any way to fix this? Do I need to write my own on_query_completions that returns a list instead?

Thanks

0 Likes

#2

if it is what I am thinking it is, I fixed this issue installing the package https://packagecontrol.io/packages/All%20Autocomplete

  1. https://github.com/tushortz/Matlab-Completions/issues/2
  2. https://github.com/tushortz/Matlab-Completions/issues/2#issuecomment-241472136
0 Likes

#3

That package seems to be about auto completing symbols from other views. I think this is a bug with how completions work.

0 Likes

#4

I think this is intended, albeit a little cumbersome in case you don’t want it.

ST basically prioritizes explicit completions over implicit, and buffer completions are implicit on this case.

0 Likes

#5

I think if they were mixed into the same list it would be fine. The way it works right now is that the only the explicit completions show up until there is no match, then the implicit ones do. This makes it hard to tell if I typo’d something because I don’t see it in the list.

0 Likes

#6

Just like the way snippets work.

0 Likes

#7

So I tracked it down.

If you have a completion with a “.” in it, it causes the bahaviour I described. Just make sure everything in your .sublime-completions file matches \w and it works as expected.

1 Like