Atom JavaScript 自动完成
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30954674/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Atom JavaScript Autocomplete
提问by coco_
I'm new to Atomand JavaScript, Atom seems to be pretty good for web developing.
我是Atom和 JavaScript 的新手,Atom 似乎非常适合 Web 开发。
But to my best knowledge, it seems that there is no Atom package for enabling JavaScript autocomplete.
但据我所知,似乎没有用于启用 JavaScript 自动完成的 Atom 包。
Does anyone know a package doing this or does Atom have a plan to support JavaScript autocomplete?
有没有人知道这样做的包,或者 Atom 有支持 JavaScript 自动完成的计划吗?
采纳答案by nwinkler
Since JavaScript is loosely coupled, providing a working autocomplete solution is not as easy as for statically typed languages like Java. Your best bets with Atom are the following packages:
由于 JavaScript 是松散耦合的,因此提供一个有效的自动完成解决方案并不像 Java 这样的静态类型语言那么容易。您对 Atom 的最佳选择是以下软件包:
- autocomplete-plus- this is now bundled with Atom as the default autocomplete provider
- ternjs- this looks pretty good, but requires some configuration.
- autocomplete-plus- 现在与 Atom 捆绑在一起作为默认的自动完成提供程序
- ternjs- 这看起来不错,但需要一些配置。
I suggest you give these a try.
我建议你试试这些。
回答by nayan verma
I think you should go for atom-ternjs
我认为你应该选择atom-ternjs
This is java script intelligence for atom
这是原子的java脚本智能
You need to change(Enable) setting for atom-ternjs
您需要更改(启用) atom-ternjs 的设置
- Use autocomplete-snippets
- Display both autocomplete-snippets and function name
- 使用自动完成代码段
- 显示自动完成代码段和函数名称
and many more depends on your requirements ...
还有更多取决于您的要求......
回答by albert200000
If you are using es6 JavaScript or TypeScript or Node then ide-typescriptis good. It uses language server similar to vscode and understands imported/required modules from your project and npm libraries. Also there is quite similar atom-typescriptwith more focus on TypeScript but can be also configured for JavaScript as described here - https://github.com/TypeStrong/atom-typescript/blob/master/docs/faq.md#i-want-to-use-atom-typescript-with-javascript-too.
如果您使用的是 es6 JavaScript 或 TypeScript 或 Node,那么ide-typescript是不错的选择。它使用类似于 vscode 的语言服务器,并理解从你的项目和 npm 库中导入/需要的模块。还有非常相似的atom-typescript,更侧重于 TypeScript,但也可以按照此处所述为 JavaScript 进行配置 - https://github.com/TypeStrong/atom-typescript/blob/master/docs/faq.md#i- want-to-use-atom-typescript-with-javascript-too。