atom-path-intellisense
plug-in development has been stopped since github has now ended Atom IDE development.
This repo will continue to be available though no further support will be done.
I want to say thanks to all of you who gave this a try and a special shout out to contributors.
Autocomplete provider based on atom autocomplete-plus package.
Current build status 🏭 | See Change Log 💈
Linux | MacOS | Windows |
---|---|---|
- Provides path suggestions based on typed path and context.
- By default suggestions are provided by pressing
ctrl + space
. Uncheckmanual-suggest
configuration setting to get suggestions at typing. - Suggestions are provided within scope selectors configured on
allowed-scopes
configuration setting. Default selectors cover pretty much languages but is extensible by adding more scope selectors.
Note to developers
If you find any selector combination that's missing or can improve this package make a PR with your add to allowed-scopes configuration setting.
- Escaping of single and double quotes is allowed for files and directories.
- Path suggestions mechanism relies on providers for appropriate grammar and selectors.
Default providers are the very basic path suggestion providers on this package given path suggestions for paths relative to current file and working out of the box on all allowed scopes.
- Provides suggestions for paths relative to current file path.
- Works out-of-the-box on allowed scope selectors.
- Suggestions for paths relative to current file are shown by typing self
./
or parent../
directories. - Suggestions for paths relative to user's home directory are shown by typing:
~/
. - Suggestions for absulute paths are shown by typing forward slash:
/
targeting to base path configured withinroot-base-path
setting.When not in a project, suggestions fallback to FileSystem root directory shown files with appropriate permisions.
- Provides suggestions for current file path.
- Works on following scope selectors:
.string.quoted', '.text .string', '.text.html.basic'
.
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.
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.
See more of extended providers ...
Install from atom´s settings/packages tab or run following command on a terminal:
apm install atom-path-intellisense
This package exports following configuration settings to config.cson
file:
Scope selectors (can be comma- separated) for which suggestions are shown. Apply to default suggestion providers. Other providers specify more specific selectors.
See: Scope Selectors Reference
- Type:
string
- Default:
'.source .string, .source.css.scss, .source.shell, .text .string, .text.html.basic'
Enable / disable debug options.
Atom's dev mode
$ atom --dev .
overrides this setting astrue
.
- Type:
boolean
- Default:
true
if Atom's dev mode$ atom --dev .
is enabled.false
otherwise.
If enabled (recomended), suggestions are provided by pressing ctrl + space
. Uncheck to get suggestions at typing.
- Type:
boolean
- Default:
true
If enabled, All suitable providers that can resolve suggestions are called with no priority consideration. (A bit lower operation).
- Type:
boolean
- Default:
false
Path for root dir on relative paths /
.
Special values are:
system
: Targets to FileSystem root dir.project
: Targets to current project root dir.When not in a project, suggestions fallback to FileSystem root directory shown files with appropriate permisions.
Windows and Unix paths are accepted depending on OS.
On Windows, absolute unix path/
is resolved to system partition:C:
in most cases. Eg:/Windows/
is resolved toC:\\Windows
.
- Type:
string
- Default:
project
Example of config.cson:
"*":
"atom-path-intellisense":
"allowed-scopes": ".source .string, .source.shell, .text .string, .text.html.basic"
"enable-debug": false
"manual-suggest": true
"provider-strategy-all": false
- Scope selectors matching features are based on
Atom
selectors.js
. - Scope selectors cache is based on
autocomplete-plus
scope-helpers.js
. - Specs are based on
autocomplete-paths
specs
ones.