This package provides the following services:
atom-path-intellisense
Path Intellisense support for atom.
Autocomplete provider based on atom autocomplete-plus package.
Change Log π
Current build status π | SeeLinux | MacOS | Windows |
---|---|---|
Features
- 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.
Providers
Default Providers π―
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.
Default
Current file relative path provider πͺ Features
- 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.
Default
Current file path provider πͺ Features
- Provides suggestions for current file path.
- Works on following scope selectors:
.string.quoted', '.text .string', '.text.html.basic'
.
Extended Providers β€
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.
Extended
Node.js path provider Node.js path provider gives suggestions for Node.js module imports.
πͺ Features
- 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.
extended providers ...
See more of
Installation
Install from atomΒ΄s settings/packages tab or run following command on a terminal:
apm install atom-path-intellisense
Configuration
This package exports following configuration settings to config.cson
file:
allowed-scopes
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-debug
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.
manual-suggest
If enabled (recomended), suggestions are provided by pressing ctrl + space
. Uncheck to get suggestions at typing.
- Type:
boolean
- Default:
true
provider-strategy-all
If enabled, All suitable providers that can resolve suggestions are called with no priority consideration. (A bit lower operation).
- Type:
boolean
- Default:
false
root-base-path
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
Acknowledgements π
- 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.