Atom-Path-Intellisense
Tags: atom, paths, autocomplete, suggestions
Published: 2019-11-07 09:52:35

[![](https://raw.githubusercontent.com/apercova/imageio/master/atom-path-intellisense/logo/logo_template_github.png)](https://atom.io/packages/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](https://atom.io/packages/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](https://atom.io/packages/autocomplete-plus).

![](https://raw.githubusercontent.com/apercova/imageio/master/atom-path-intellisense/providers/filepath_rel_provider.gif)  

![](https://raw.githubusercontent.com/apercova/imageio/master/atom-path-intellisense/providers/filepath_rel_provider_home.gif)  

#### 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:
```bash
  apm install atom-path-intellisense
```

#### Why another path suggestion package?

Well I knew about some other [packages](https://atom.io/packages/autocomplete-paths) 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](https://github.com/apercova/atom-path-intellisense/issues) 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 https://github.com/apercova/atom-path-intellisense %}