Atom-path-intellisense is not only based on default providers. Decoupling path suggestions mechanism from autocomplete-plus provider API gives the advantage of writing extended providers that cover more specific contexts and can be formatted in their own way.
We refer as extended providers to providers targeted to a specific language or more specific scope selectors and context.
An extended provider has to be in compliance with the following:
- Extend base class
BasePathProvider
. - Implement following methods:
canResolve()
resolve()
activate
. (optional)deactivate
. (optional)
- Optionally use a custom formatter. Eg. to trim file extensions.
Custom formatters have to be in compliance with the following:
- Extend base class
BaseFormatter
. - Implement
format
method in order to format raw suggestions.
- Extend base class
Node.js path provider gives suggestions for Node.js module imports.
- It's enabled on
JavaScript
,CoffeeScript
andTypeScript
files at.string.quoted
scope selector. - Supports both
require()
and ES6 moduleimport
statements. - Provides suggestions for Node.js built-in modules, local modules (on project
node_modules
directory) and modules relative to current file. - Filters JavaScript files by
.js
extension. - Removes file extension at selecting any suggestion.
- Is complemented by Default path providers for path suggestions on broader scopes.