Atom auto complete is a bit stupid


#1

I installed the language-rust packages. I am not too sure what package deals with autocomplete and shit but it seems a bit stupid; as soon as I type fn m I get a bunch of suggestions such as main() to be autocompleted which is fine. But when I click on the suggestion, then I get this

fn fn main() {
unimplemented!()
}

Like why am I getting fn fn twice, why can’t it be a bit smarter to know that I already typed fn.

Are there any better packages I can install?


#2

You should figure out which package is doing the autocomplete. Then we can give you specific advice.


#3

Does this package “language-rust” handle the autocomplete?


#4

The package has no code, just grammar, styles, settings, and snippets.


#5

Uploading… Are one of these packages responsible for autocomplete?


#6
  'main':
    'prefix': 'main'
    'body': '''
      fn main() {
      \t${1:unimplemented!()}
      }
    '''

fn is part of the snippet definition for main; it’s duplicating because you typed it yourself as well. Just type main, or define your own snippets.


#7

Well the thing is that it could be a little smarter to know what you have typed out and it does not re type the same thing, for example if I typed fn then if it suggestes to auto complete the whole thing. Even Microsoft Visual Studio (not visual studio code) is smarter than this.


#8

That’s not about smartness. It’s how the snippet is defined.

And what you want is possible, it just takes some knowledge of JS and the autocomplete API.