简体   繁体   中英

Scala with VScode

I started to use vscode for python development. And I really like it, does anyone know how to extend VScode so I can write scala in it as well ?

At the bare minimum I need to get syntax highlighting working.

Scala works well in VS Code 2019.

There's official syntax highlighting , and a Language Server called Metals (which replaces Ensime which is mentioned in other answers).

There is one here:

https://github.com/IliyaTryapitsin/vscode-scala

You can add it by reading the readme there which is:

Run VSCode

code --enableExtensionGallery

Press F1 then input:

for scala installation

ext install scala

for sbt installation

ext install sbt

for snippets installation

ext install scalasnippets

If your NOT using Intellij or Eclipse and want to stick to VSCode, then I highly recommend Ensime & Ensime plugin below: https://marketplace.visualstudio.com/items?itemName=dragos.scala-lsp Also check out, www.ensime.org It's a bit more involved to setup ensime env but still worth it.

Discussion of two is below here: https://www.reddit.com/r/scala/comments/5eu9if/intellij_vs_ensime/

However, Intellij has improved a lot. So, the beauty contest is a matter of judgement call. I have been switch back & forth between many variations (Emacs, Intellij, neovim, VSCode). It's a complicated language. So, I need all the help I can get!

如果您深入研究应用程序路径,我认为它可以在 .js 中扩展,例如查看 javascript 和 typescript 文件夹(尽管我还没有尝试过)

Visual Studio Code does not have a language extensible story yet, but it could be coming soon. https://code.visualstudio.com/Docs/languages#_common-questions

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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