Scala language support for Atom IDE, powered by Scalameta language server.
The project is in active development and may have some rough edges. You are welcome to try it out and provide any feedback in the Gitter chat or Github issues.
This plugin is written in Scala.js, so if you are a Scala developer looking for better development experience in Atom, you're encouraged to contribute. Check the contributing guide and open issues especially the ones marked with help wanted
label.
The work of this plugin is to launch the language server and wire communication with it to the Atom IDE services. Most of the interesting stuff is happening on the server side, so check also the scalameta/language-server project.
Here is a list of the features which are implemented. It doesn't mean that they all work well, just that they are implemented on the server side and are supported by this plugin. Also notice that some features may take time to activate after you open a new file or change code.
- Formatting with Scalafmt:
- Add
.scalafmt
config to the project - Use cmdshiftC hotkey
- It formats the whole file
- Add
- Diagnostics (linting with Scalafix and presentation compiler):
- If you have
.scalafix
configuration in the project, you will see linting messages in the diagnostics panel and red underlines in the code - You will also see compilation errors from the presentation compiler as you type
- If you have
- Definitions:
- Hold cmd and hover to preview the definition or click to jump to the source
- References:
- Right-click on a symbol and choose
Find References
in the context menu - Or open command palette and run
Find References
command
- Right-click on a symbol and choose
- Code Highlights:
- When cursor is placed on a symbol, all its occurrences in the file should get highlighted
- Datatips (type on hover):
- Just hover over a symbol to see its type
- You can also hold alt to see the type of symbol under the cursor
- Outline view (symbols tree):
- Use altO to open it
- Auto completions as you type with presentation compiler
- This requires running
*:scalametaEnableCompletions
in sbt first
- This requires running
- Signature Help (experimental UI):
- When you type a method name and an open parenthesis you should see information about method parameters
See also default Atom IDE keybindings.
For the full list of implemented and planned features see the server roadmap.
-
You can install it using Atom interface or by running this command:
apm install ide-scala
On the first launch it will automatically install its dependencies if needed:
- language-scala for basic Scala syntax highlighting
- atom-ide-ui for the Atom IDE interface
-
If you are using jEnv you may need to export
JAVA_HOME
using jEnv plugin:jenv enable-plugin export
- Follow Scalameta language server beta testing instructions to prepare your Scala projects.
- Open a project in Atom. Once you open a Scala file, server will get launched and you will see a progress indicator in the status bar.
- Notice that when you close all tabs with Scala files, language server will be stopped. See atom-languageclient#141 for discussion on this behavior.