• Stars
    star
    1,137
  • Rank 39,287 (Top 0.8 %)
  • Language
    Scala
  • License
    Apache License 2.0
  • Created over 12 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Scala plugin for IntelliJ IDEA

official JetBrains project Scala Plugin Build & Test Discord

Scala Plugin for IntelliJ IDEA

The plugin adds support for the Scala language to IntelliJ IDEA.
It enables multiple features such as:

  • Coding assistance (highlighting, completion, formatting, refactorings, code inspection etc.)
  • Navigation, search, information about types and implicits
  • Integration with build tools: SBT, Maven, Gradle, BSP
  • Testing frameworks support (ScalaTest, MUnit, Specs2, uTest)
  • Scala debugger, worksheets and Ammonite scripts
  • And many more!

(note that HOCON support was moved to a separate plugin)

General information

  • To get information about how to install and use this plugin in IDEA, please use IntelliJ IDEA online help

  • If you have any question about the Scala plugin, we'd be glad to answer it in our discord channel

Reporting issues

If you found a bug, please report it on our issue tracker

Contributing

Please see CONTRIBUTING.md

Setting up the project

Prerequisites

In order to take part in Scala plugin development, you need:

  1. IntelliJ IDEA 2022.3 or higher with a compatible version of Scala plugin
  2. JDK 17 (you can download it via IntelliJ IDEA)
  3. (optional but recommended)
    Enable internal mode in IDEA to get access to helpful internal actions and debug information

Setup

  1. Clone this repository to your computer
$ git clone https://github.com/JetBrains/intellij-scala.git
  1. Open IntelliJ IDEA. From the Welcome screen or File menu, click Open, and point to the directory where you cloned the Scala plugin sources. It will be automatically imported as a sbt project.

  2. In the next step, select JDK 17 as project JDK (create it from an installed JDK if necessary).

  3. Select the scalaCommunity run configuration and select the Run or Debug button to build and start a development version of IDEA with the Scala plugin.

Running the Plugin

Debugging mode

The easiest way to try your changes is typically to launch the scalaCommunity run configuration which is created when you set up the project as described above. Under the hood it will launch IntelliJ IDEA with pre-installed Scala Plugin, built from sources.

As a standalone plugin

To run and distribute a modified version of the plugin in a regular IntelliJ instance, you need to package it.

  1. on the sbt shell, run packageArtifactZip. This will output the generated plugin zip location (typically into <project directory>/target/scala-plugin.zip).
  2. In IntelliJ, open Preferences, section Plugins, choose "Install plugin from disk..." and navigate to the scala-plugin.zip
  3. Restart IntelliJ

Running the Tests

To run tests properly, the plugin needs to be packaged. On the sbt shell:

  1. packageArtifact
  2. runFastTests

The "fast tests" can take over an hour. To get a quick feedback on project health, run only the type inference tests:

> runTypeInferenceTests

GitHub Actions build

The project is configured to build and run the typeInference tests and fast tests with Github Actions.
The full test suite isn't run to avoid really long build times.

Common problems

  1. Error object BuildInfo is already defined ... during compilation of the project
    BuildInfo is an sbt plugin that exposes some of the sbt build metadata to the main project. We use it to forward some dependencies versions from the build sources to main project sources. Sometimes during import this generated source root is added to scala-impl module multiple times. Make sure it's only included once by removing duplicates.

  2. Can't browse IntelliJ Platform sources
    When loading Scala Plugin project in sbt, the IntelliJ platform is downloaded to <home>/.ScalaPluginIC/sdk/<sdk version>/. IntelliJ platform sources should be automatically attached after project has been imported and indices have been built.
    However, sometimes this doesn't happen and the sources are not attached. As a result you see decompiled code when opening a Platform API class.
    Solution:
    Invoke "Attach Intellij Sources" action (you need to enable internal mode to access this action

  3. After building the project you see git local changes in ImportsPanel.java (or similar files). All IdeBorderFactory.PlainSmallWithIndent are replaced with BorderFactory
    Solution: enable internal mode.
    UI Designer uses different border class in internal mode, see com.intellij.uiDesigner.make.FormSourceCodeGenerator#borderFactoryClassName

  4. Unexpected local git changes in uiDesigner.xml or other files in .idea directory
    It may happen due to disable internal mode or by enabling it after/during setup.
    The solution to this problem might be to revert these changes, enable internal mode (if it has not already been done) and restart IntelliJ.

Other

Investigation performance issues

  • YourKit
  • There is a "Scala plugin profiler" tool window to track invocations of methods with @Cached* or @Measure annotations (from org.jetbrains.plugins.scala.macroAnnotations package) in real time. The tool window is available in internal mode or if -Dinternal.profiler.tracing=true is passed to IDEA using custom VM options

Generating test coverage reports

You might want to generate a test coverage report for a given package. It can be done by running for example the following:

sbt "project scala-impl;set coverageEnabled := true;project scalaCommunity;testOnly org.jetbrains.plugins.scala.codeInspection.declarationRedundancy.*;scala-impl/coverageReport"

Close to the very tail of the output of this command you will find a line that gives you the location of the generated report, for example:

[info] Written HTML coverage report [/Users/alice/intellij-scala/scala/scala-impl/target/scala-2.13/scoverage-report/index.html]

Note that in order to continue working from IntelliJ IDEA again you need to perform Build > Rebuild Project.

More Repositories

1

kotlin

The Kotlin Programming Language.
Kotlin
45,725
star
2

intellij-community

IntelliJ IDEA Community Edition & IntelliJ Platform
16,452
star
3

compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
Kotlin
14,613
star
4

JetBrainsMono

JetBrains Mono – the free and open-source typeface for developers
Shell
10,126
star
5

ideavim

IdeaVim – A Vim engine for JetBrains IDEs
Kotlin
7,980
star
6

Exposed

Kotlin SQL Framework
Kotlin
7,824
star
7

kotlin-native

Kotlin/Native infrastructure
Kotlin
7,048
star
8

ring-ui

A collection of JetBrains Web UI components
TypeScript
3,555
star
9

kotlinconf-app

KotlinConf Schedule Application
Kotlin
2,830
star
10

intellij-platform-plugin-template

Template repository for creating plugins for IntelliJ Platform
Kotlin
2,791
star
11

skija

Java bindings for Skia
Java
2,605
star
12

create-react-kotlin-app

Create React apps using Kotlin with no build configuration
JavaScript
2,477
star
13

projector-docker

Run JetBrains IDEs remotely with Docker
Shell
2,209
star
14

intellij-plugins

Open-source plugins included in the distribution of IntelliJ IDEA Ultimate and other IDEs based on the IntelliJ Platform
Java
2,002
star
15

svg-sprite-loader

Webpack loader for creating SVG sprites.
JavaScript
1,998
star
16

skiko

Kotlin MPP bindings to Skia
Kotlin
1,672
star
17

compose-multiplatform-ios-android-template

Compose Multiplatform iOS+Android Application project template
Kotlin
1,563
star
18

MPS

JetBrains Meta programming System
JetBrains MPS
1,500
star
19

lets-plot

Multiplatform plotting library based on the Grammar of Graphics
Kotlin
1,446
star
20

kotlin-web-site

The Kotlin programming language website
JavaScript
1,413
star
21

intellij-platform-gradle-plugin

Gradle plugin for building plugins for IntelliJ-based IDEs
Kotlin
1,377
star
22

phpstorm-stubs

PHP runtime & extensions header files for PhpStorm
PHP
1,297
star
23

kotlin-wrappers

Kotlin wrappers for popular JavaScript libraries
Kotlin
1,292
star
24

idea-gitignore

.ignore support plugin for IntelliJ IDEA
Kotlin
1,287
star
25

projector-server

Server-side library for running Swing applications remotely
Kotlin
1,224
star
26

resharper-unity

Unity support for both ReSharper and Rider
C#
1,198
star
27

intellij-sdk-docs

IntelliJ SDK Platform Documentation
Markdown
1,181
star
28

xodus

Transactional schema-less embedded database used by JetBrains YouTrack and JetBrains Hub.
Java
1,155
star
29

kotless

Kotlin Serverless Framework
Kotlin
1,124
star
30

JetBrainsRuntime

Runtime environment based on OpenJDK for running IntelliJ Platform-based products on Windows, macOS, and Linux
Java
1,118
star
31

intellij-sdk-code-samples

Mirror of the IntelliJ SDK Docs Code Samples
Java
980
star
32

js-graphql-intellij-plugin

GraphQL language support for WebStorm, IntelliJ IDEA and other IDEs based on the IntelliJ Platform.
Java
875
star
33

android

Android Plugin for IntelliJ IDEA. This repository is a subset of https://git.jetbrains.org/?p=idea/android.git cut according to GitHub file size limitations.
Kotlin
863
star
34

projector-client

Common and client-related code for running Swing applications remotely
Kotlin
813
star
35

projector-installer

Install, configure and run JetBrains IDEs with Projector Server on Linux or in WSL
Python
810
star
36

Grammar-Kit

Grammar files support & parser/PSI generation for IntelliJ IDEA
Java
688
star
37

Arend

The Arend Proof Assistant
Java
676
star
38

amper

Amper - a build and project configuration tool with a focus on the user experience and the IDE support
Kotlin
621
star
39

jediterm

Pure Java Terminal Emulator. Works with SSH and PTY.
Java
611
star
40

compose-multiplatform-template

Compose Multiplatform Application project template
Kotlin
603
star
41

markdown

Markdown parser written in kotlin
Kotlin
590
star
42

jewel

An implementation of the IntelliJ look and feels in Compose for Desktop
Kotlin
573
star
43

Nitra

Public Nitra repository
Nemerle
549
star
44

lincheck

Framework for testing concurrent data structures
Kotlin
520
star
45

intellij-micropython

Plugin for MicroPython devices in PyCharm and IntelliJ
Python
482
star
46

kotlin-playground

Self-contained component to embed in websites for running Kotlin code
JavaScript
422
star
47

colorSchemeTool

Python
396
star
48

lets-plot-kotlin

Grammar of Graphics for Kotlin
Kotlin
389
star
49

Qodana

πŸ“ Source repository of Qodana Help
388
star
50

rd

Reactive Distributed communication framework for .NET, Kotlin, C++. Inspired by Rider IDE.
C#
373
star
51

java-annotations

Annotations for JVM-based languages.
Java
362
star
52

compose-multiplatform-desktop-template

Compose Multiplatform Desktop Application project template
Kotlin
360
star
53

phpstorm-attributes

PhpStorm specific attributes
PHP
357
star
54

Unity3dRider

Unity JetBrains Rider integration
348
star
55

pty4j

Pty for Java
Java
338
star
56

resharper-fsharp

F# support in JetBrains Rider
F#
319
star
57

godot-support

C#
315
star
58

phpstorm-workshop

Code for the PhpStorm workshop
PHP
287
star
59

awesome-pycharm

A curated list of resources for learning and using PyCharm, a Python IDE from JetBrains
271
star
60

web-types

JSON standard for documenting web component libraries for IDEs, documentation generators and other tools
TypeScript
270
star
61

meta-runner-power-pack

A set of Meta-runners for TeamCity
PowerShell
256
star
62

inspection-plugin

Gradle plugin to launch IDEA inspections
Kotlin
255
star
63

youtrack-mobile

A iOS and Android client for YouTrack
TypeScript
253
star
64

gradle-changelog-plugin

Plugin for parsing and managing the Changelog in a "keep a changelog" style.
Kotlin
252
star
65

ideolog

Interactive viewer for '.log' files.
Kotlin
250
star
66

qodana-action

βš™οΈ Scan your Go, Java, Kotlin, PHP, Python, JavaScript, TypeScript, .NET projects at GitHub with Qodana. This repository contains Qodana for Azure, GitHub, CircleCI and Gradle
JavaScript
234
star
67

gradle-idea-ext-plugin

Plugin to store IJ settings in gradle script
Groovy
227
star
68

php-timeline

Notable events of PHP history
223
star
69

resharper-rider-samples

Simple interactive exercises to help learn ReSharper and Rider
C#
221
star
70

la-clojure

Clojure plugin for IntelliJ IDEA
Java
220
star
71

kotlin-compiler-server

Server for executing kotlin code
Kotlin
216
star
72

jdk8u_jdk

Java
210
star
73

jcef

A simple framework for embedding Chromium-based browsers into Java-based applications.
Java
206
star
74

pest-intellij

The official Pest Plugin for PhpStorm / IntelliJ IDEA
Kotlin
195
star
75

youtrack-workflows

YouTrack Custom Workflow Repository
JavaScript
194
star
76

compose-for-web-demos

Historical repository of early Compose for Web effort.
176
star
77

psiviewer

PSI Viewer for IntelliJ IDEA plugin development
Java
175
star
78

svg-mixer

Node.js toolset for generating & transforming SVG images and sprites in modern way
JavaScript
173
star
79

phpstorm-docker-images

Pre-configured Docker images used by PhpStorm team
Dockerfile
170
star
80

jetbrains_guide

JetBrains Guides where Developer Advocacy and the community share ideas.
CSS
168
star
81

kotlin-web-demo

Online mini-IDE for Kotlin
Kotlin
168
star
82

rider-efcore

Entity Framework Core UI plugin for JetBrains Rider
Kotlin
167
star
83

intellij-plugin-verifier

Compatibility verification tool for IntelliJ Platform plugins
Kotlin
165
star
84

intellij-samples

Code that demonstrates various IntelliJ IDEA features
Java
163
star
85

jdk8u_hotspot

C++
159
star
86

resharper-rider-plugin

https://www.jetbrains.com/help/resharper/sdk/
PowerShell
158
star
87

qodana-cli

πŸ”§ JetBrains Qodana’s official command line tool
Go
154
star
88

teamcity-messages

Python Unit Test Reporting to TeamCity
Python
139
star
89

ruby-type-inference

Dynamic definitions and types provider for ruby static analysis
Kotlin
136
star
90

educational-plugin

Educational plugin to learn and teach programming languages such as Kotlin, Java, Python, JavaScript, and others right inside of JetBrains IntelliJ Platform based IDEs.
Kotlin
134
star
91

resharper-angularjs

ReSharper plugin for AngularJS support
JavaScript
134
star
92

clion-remote

134
star
93

golandtipsandtricks

This is an ever evolving repository for GoLand Tips&Tricks
Go
132
star
94

python-skeletons

The python-skeltons repo is deprecated: use PEP 484 and Typeshed instead
Python
132
star
95

clion-wsl

Shell
130
star
96

phpstorm-phpstan-plugin

PHPStan plugin for PhpStorm
Java
130
star
97

teamcity-docker-samples

TeamCity docker compose samples
Shell
128
star
98

phpstorm-psalm-plugin

Psalm plugin for PhpStorm
Java
126
star
99

jdk8u

Shell
123
star
100

YouTrackSharp

.NET Standard 2.0 Library to access YouTrack API.
C#
123
star