Nastromo
Nastromo

Reputation: 632

How to setup Atom JS autocomplete?

I'm trying to get autocomplete suggestions from my Atom code editor. When I'm trying doc I expecting document and when I typing document.que I'm expecting Atom would show me .querySelector(). And it's doesn't happening. I've installed these packages to resolve the issue:

After that I still doesn't get autocomplete for doc or document. My -tern.project file looks like this:

{
  "ecmaVersion": 6,
  "libs": [],
  "loadEagerly": [],
  "dontLoad": [
    "node_modules/**"
  ],
  "plugins": {
    "doc_comment": true,
    "complete_strings": {
      "maxLength": 15
    },
    "node": {
      "dontLoad": "",
      "load": "",
      "modules": ""
    },
    "modules": {
      "dontLoad": "",
      "load": "",
      "modules": ""
    },
    "es_modules": {}
  }
}

So, how do you autocomplete JS in Atom? Interesting thing - notice if I create array and try array. then Atom gives me suggestions like .pop .push and others but why it doesn't give me a document. => .querySelector() and other for DOM manipulation.

My Atom config.cson:

"*":
  core:
    telemetryConsent: "no"
  editor:
    fontSize: 13
  "exception-reporting":
    userId: "bla-bla-bla"
  "linter-ui-default":
    showPanel: true

Upvotes: 2

Views: 3273

Answers (1)

Nastromo
Nastromo

Reputation: 632

I found the answer. Need to activate: Packages => Atom Ternjs => Configure Project => and here need to checkmark for Browser option.

Upvotes: 4

Related Questions