Sublime Forum

Advice on autocomplete plugins

#1

I haven’t had much success in the past getting the kind of autocomplete I would like for javascript.
I was wondering of anyone could give me some advice.

There are two examples of behavior that if I could get working I would consider it satisfactory.

1: if I begin to type the word console, either console or console.log shows up in the suggestions.

2: pressing . on a variable that has an array type shows the array methods in the suggestions.

Even just the first, would be satisfactory for me especially if there is a lightweight plugin for it.

I already installed javascript and nodejs snippets, but I am suprised that I have to type console.log in its entirety, and it never comes up as a suggestion, while other words like “connections” do.

Why would console.log never autocomplete? It seems like this would be one of the most commonly desired features, but maybe I am not understanding the role of snippets plugins?

The second part is actually less important, because I am wary of big plugins which seemed to impact startup time in the past.

I’m sure this kind of question has been asked, but have not been able to figure this seemingly simple thing out yet so I thought I should just ask.

Thanks for any help.

0 Likes

#2

For (1), you can add a custom sublime completions file.

For (2), you’d have to use a package that did type analysis. Maybe the Flow type checker could be employed, although in many cases it simply won’t be possible to type un-annotated JavaScript. I don’t know whether there is an existing package that does this.

0 Likes