如何设置 Atom JS 自动完成?
How to setup Atom JS autocomplete?
我正在尝试从我的 Atom 代码编辑器中获取 自动完成 建议。当我尝试 doc
时,我期望 document
,而当我输入 document.que
时,我期望 Atom 会显示 .querySelector()
。它没有发生。我已经安装了这些软件包来解决问题:
- atom-ternjs
在那之后,我仍然没有为 doc
或 document.
自动完成我的 -tern.project 文件如下所示:
{
"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": {}
}
}
那么,您如何在 Atom 中自动完成 JS?有趣的事情 - 注意如果我创建数组并尝试 array.
然后 Atom 给我建议像 .pop .push 和其他但为什么它不给我一个 document.
=> .querySelector()
和其他DOM 操纵。
我的原子 config.cson:
"*":
core:
telemetryConsent: "no"
editor:
fontSize: 13
"exception-reporting":
userId: "bla-bla-bla"
"linter-ui-default":
showPanel: true
我找到了答案。需要激活:
Packages => Atom Ternjs => Configure Project => 这里需要勾选 Browser 选项。
我正在尝试从我的 Atom 代码编辑器中获取 自动完成 建议。当我尝试 doc
时,我期望 document
,而当我输入 document.que
时,我期望 Atom 会显示 .querySelector()
。它没有发生。我已经安装了这些软件包来解决问题:
- atom-ternjs
在那之后,我仍然没有为 doc
或 document.
自动完成我的 -tern.project 文件如下所示:
{
"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": {}
}
}
那么,您如何在 Atom 中自动完成 JS?有趣的事情 - 注意如果我创建数组并尝试 array.
然后 Atom 给我建议像 .pop .push 和其他但为什么它不给我一个 document.
=> .querySelector()
和其他DOM 操纵。
我的原子 config.cson:
"*":
core:
telemetryConsent: "no"
editor:
fontSize: 13
"exception-reporting":
userId: "bla-bla-bla"
"linter-ui-default":
showPanel: true
我找到了答案。需要激活: Packages => Atom Ternjs => Configure Project => 这里需要勾选 Browser 选项。