DEV Community

Alonso Pérez
Alonso Pérez

Posted on

Atom-Path-Intellisense

In this post I want to share with you an Atom Editor (https://atom.io) package that I've been developing on my spare time: Atom-path-intellisense.

This package allows you to get path suggestions on your code based on grammar and context. Its based on awesome Atom package Autocomplete-plus.

Main features are:

  • Provides path suggestions based on typed path and context.
  • Has a path suggestion provider model that makes it easier write new providers for specific grammars and contexts. Eg. Node.js require or ES6 import statements.
  • Has a default provider for relative paths (./,../,~/,/)
  • By default suggestions are provided on-demand by pressing ctrl + space in order to avoid wasting of resources with each time user writes down. This setting is configurable.
  • Suggestions are provided within configured scope selectors. Default selectors cover pretty much languages but is extensible by adding more scope selectors.
  • Escaping of single and double quotes is supported for files and directories.

Installation

Install from atom´s settings/packages tab or run following command on a terminal:

  apm install atom-path-intellisense
Enter fullscreen mode Exit fullscreen mode

Why another path suggestion package?

Well I knew about some other packages that already do the job! but I wasn't able to make those packages work on other contexts. Eg. Bash scripts or XML files.

So I decided make a package for path suggestions based on grammar and context that work even on plain-text files, given suggestions for paths relative to current file and in a cli-like way allowing file tree navigation.

What at the beginning started as a very short-scoped package soon started to have more specific needs for other types of grammars with their own requirements. For instance I had to develop an extended provider version of the initial package to make it easier resolving paths for Node.js require and ES6 import statements with its own format. Eg. trimmed file extensions.

If you are using Atom Editor, give this package a try and if you find it useful for you,spread the word and let more developers know about it.

If you find an issue, have a suggestion or any questions regarding its use, feel free to open an issue or leave a comment on this post.

Development is in progress and contributions are welcome to make this package a useful tool for day to day coding. If willing to improve it, don't hesitate. :)

GitHub logo apercova / atom-path-intellisense

Path intellisense support for atom

atom-path-intellisense

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…

Latest comments (0)