Skip to content
This repository has been archived by the owner on Jan 26, 2023. It is now read-only.

Latest commit

 

History

History
133 lines (110 loc) · 8.93 KB

README.md

File metadata and controls

133 lines (110 loc) · 8.93 KB

📢 Deprecation notice 💔

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.


Path Intellisense support for atom.

Autocomplete provider based on atom autocomplete-plus package.
APM APM Inline docs Maintainability built with gulp contributions welcome License: MIT

Current build status 🏭 | See Change Log 💈

Linux MacOS Windows
CircleCI Build Status Build status

Features

  • Provides path suggestions based on typed path and context.
  • By default suggestions are provided by pressing ctrl + space . Uncheck manual-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.

Current file relative path provider Default

💪 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 within root-base-path setting.

    When not in a project, suggestions fallback to FileSystem root directory shown files with appropriate permisions.

Current file path provider Default

💪 Features

  • 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 Extended

Node.js path provider gives suggestions for Node.js module imports.

💪 Features
  • It's enabled on JavaScript, CoffeeScript and TypeScript files at .string.quoted scope selector.
  • Supports both require() and ES6 module import 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.

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 as true.

  • 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 to C:\\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 🏆