Skip to content

atom-community/autocomplete-paths

Folders and files

NameName
Last commit message
Last commit date

Latest commit

e614d22 · Mar 4, 2021
Feb 23, 2021
Mar 4, 2021
Mar 4, 2021
Feb 7, 2021
Aug 11, 2017
Mar 2, 2021
Jan 24, 2021
Mar 2, 2021
Feb 7, 2021
Mar 4, 2021
Feb 7, 2021
Mar 3, 2021
Feb 7, 2021
Nov 25, 2020
Mar 4, 2021
Mar 3, 2021
Feb 7, 2021

Repository files navigation

autocomplete+ paths suggestions Build Status

Gitter

View the changelog

Adds path autocompletion to autocomplete+ depending on scope and prefix. Supports custom scopes defined by the user.

autocomplete-paths

Features

  • Support for JavaScript, CoffeeScript, TypeScript, PHP, SASS, LESS, Stylus, CSS, C, C++, Lua, Ruby and Python
  • Very efficient thanks to caching and incremental cache rebuilds (incremental builds are disabled for Windows. Please use the Rebuild Cache command.)
  • Easily extendable

Installation

You can install autocomplete-paths using the Preferences pane.

Defining scopes

autocomplete-paths triggers whenever a scope matches the current cursor position and scope descriptor. Here is an example for a JavaScript-Scope that supports the ES6 'import' syntax as well as the CommonJS require() syntax and the RequireJS define() syntax:

{
  scopes: ['source.js'], // Only triggers in JS files
  prefixes: [
    'import\\s+.*?from\\s+[\'"]', // import foo from '
    'require\\([\'"]', // require('
    'define\\(\\[?[\'"]' // define([' or define('
  ],
  extensions: ['js', 'jsx', 'ts', 'coffee'], // Only shows JS / TS / Coffee files
  relative: true, // Inserts relative paths only - defaults to true
  includeCurrentDirectory: true, // Include './' in path - defaults to true
  projectRelativePath: false, // Includes full relative path starting after the project directory
  replaceOnInsert: [ // Replaces the file extensions on insert
    ['.jsx?$', ''],
    ['.ts$', ''],
    ['.coffee$', '']
  ]
}

You can add custom scopes by adding them to your config.cson file:

"autocomplete-paths":
  scopes: [
    { ... },
    { ... },
  ]