Create an atom package to parse through the entire file system


I want to create a package that can automatically detect the path of a file that uses it, for example:

if the package is autocomplete-java, and the new file that I have opened in my editor uses this package, autocomplete-java should detect the path of this file, and detect all other files present in the same folder.

Right now, I have just registered a provider in my main coffee file for auto complete features, any help/suggestions on how to integrate the two would help as well. Thank you!


You can observe the TextEditor’s of atom using atom.workspace.observeTextEditors (editor) paired with the TextEditor’s ::getPath() to get the path of the file that is open.

As for parsing through the folder of this item, you can use node/io’s fs module for this


Check out the npm module fs-plus (from the atom folks). Makes it easy to find all files with recursion.