简体   繁体   English

如何在 Sublime 3 中设置 JavaScript?

[英]How do I set up JavaScript in Sublime 3?

I am new to JavaScript and wanted to set up my work environment.我是 JavaScript 的新手,想设置我的工作环境。 My problems might be basic or I look totally in the wrong direction so please advise me.我的问题可能是基本的,或者我的方向完全错误,所以请告诉我。

I am used to work with Sublime 3 and wanted to use it for writing JS code as well.我习惯使用 Sublime 3,也想用它来编写 JS 代码。

I spend half of a day on reserach for various autocomplete/support plugins for JavaScript but none of them seems to be working properly.我花了半天时间研究 JavaScript 的各种自动完成/支持插件,但它们似乎都没有正常工作。 Topics on subject are either outdated or misleading.有关主题的主题要么已过时,要么具有误导性。

For example, none of them recognizes basic objects like: document.例如,它们都不能识别基本对象,例如: document. or window.onload etc. (there is no autocompletion although it would be highlighted properly).window.onload等(虽然会正确突出显示,但没有自动完成功能)。

I tried:我试过了:

So in the end my question is: How do I set up Sublime and JavaScript or how can I get basic autocompletion in for JavaScript in Sublime 3?所以最后我的问题是:如何设置 Sublime 和 JavaScript 或者如何在 Sublime 3 中为 JavaScript 获得基本的自动完成功能?

Some suggestions一些建议

  • You can use JSHint您可以使用 JSHint
  • You can use Ternjs你可以使用 Ternjs
  • You can use Emmet你可以使用埃米特
  • You can use SublimeCodeIntel您可以使用 SublimeCodeIntel
  • You can use Zen Coding您可以使用 Zen Coding
  • Generate.sublime-completion file manually手动生成.sublime-completion 文件
  • Adding Snippets Custom / PackageControl / GitHub添加片段自定义/ PackageControl / GitHub

Have you tried LSP?你试过LSP吗? It works for both ST3 and ST4.它适用于 ST3 和 ST4。 https://github.com/sublimelsp/LSP-typescript https://github.com/sublimelsp/LSP-typescript

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM