/atom-ide-scala

WIP :construction: Scala language support for Atom IDE

Primary LanguageScalaMIT LicenseMIT

Atom IDE Scala language client

Scala language support for Atom IDE, powered by Scalameta language server.

🚧 WORK IN PROGRESS 🚧

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.

Features

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
  • 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
  • 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
  • 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
  • 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.

Installation

  • 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:

  • If you are using jEnv you may need to export JAVA_HOME using jEnv plugin:

    jenv enable-plugin export
    

Usage

  1. Follow Scalameta language server beta testing instructions to prepare your Scala projects.
  2. 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.
  3. Notice that when you close all tabs with Scala files, language server will be stopped. See atom-languageclient#141 for discussion on this behavior.