admin管理员组

文章数量:1410730

I'm trying to get familiar with GitHub's Atom and working with JavaScript on a large-scale project. I've been working with tutorials, and the biggest plaint I'm having with Atom is that I can't find a way to get the out of the box autoplete to work consistently.

For example, I'm following a relatively simple Node.js tutorial, using ES6 syntax, and I have the following code in a core.js file:

export function logMe(message) {
  console.log('message: ' + message);
}

In main.js file, I have the following:

import {logMe} from '../src/core'

logMe('Hello, world!');

However, when typing in main.js, I get no autoplete suggestions for logMe or anything in my core.js file. I feel like there should be either some existing functionality in autoplete-plus, or another plugin, that allows autoplete to work across import statements.

I'm trying to get familiar with GitHub's Atom and working with JavaScript on a large-scale project. I've been working with tutorials, and the biggest plaint I'm having with Atom is that I can't find a way to get the out of the box autoplete to work consistently.

For example, I'm following a relatively simple Node.js tutorial, using ES6 syntax, and I have the following code in a core.js file:

export function logMe(message) {
  console.log('message: ' + message);
}

In main.js file, I have the following:

import {logMe} from '../src/core'

logMe('Hello, world!');

However, when typing in main.js, I get no autoplete suggestions for logMe or anything in my core.js file. I feel like there should be either some existing functionality in autoplete-plus, or another plugin, that allows autoplete to work across import statements.

Share edited Apr 12, 2016 at 20:37 Richard Slater 6,3684 gold badges56 silver badges82 bronze badges asked Apr 12, 2016 at 19:58 erlloyderlloyd 4851 gold badge7 silver badges20 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 5

Have you tried using atom-ternjs it is Atom integration with the excellent TernJS. You will need to spend a bit of time generating your .tern-project file by going to the Packages menu → Atom TernjsConfigure Project, but once you have it setup it works very well.

If you don't want to go down the TernJS route, then there is a setting for the autoplete-plus package called Include Completions from All Buffers:

In my experience it can create a lot of noise and is dependent upon a the other files being open which doesn't scale well.

本文标签: nodejsJavaScript autocomplete on imported modules in GitHub39s AtomStack Overflow