Adding suggestions to ATOM


#1

Hello! I’m new to ATOM and a newbie in JavaScript, and I was wondering if I can add suggestions to comments, doing something like this:

But in comments. That meaning if I type something like “// P” it suggests “Pastilhas” in the same way it suggests on the image.

Thanks in advance!


#2

Heres’s a paint edited file with what I pretend to do:

Thanks again!


#3

Welcome to the Atom community!

What you’re looking for is called an “autocomplete provider” because it provides suggestions for the autocomplete system. We have documentation on how to build a provider and you can find examples to base yours from in the community packages. Additionally, I made a really simple provider to teach myself how to build one that you can use as a template too.


#4

Thanks! It is very helpful! :smiley:


#5

@leedohm just one more thing: in order to test what I’ve done I have to load it into a different project or can I test it on the same package that the provider is?


#6

It depends on the grammar of your provider. If your package is written in JavaScript and your provider provides suggestions for .source.js, it should work.