Slide 1

Slide 1 text

Igal Tabachnik @hmemcpy Building IntelliJ IDEA plugins in Scala

Slide 2

Slide 2 text

About me ▪ Software developer and consultant ▪ Working in Scala and FP for 4 years ▪ Passionate about productivity tools ▪ Author of the ZIO plugin for IntelliJ ▪ @hmemcpy on twitter and everywhere else

Slide 3

Slide 3 text

Agenda ▪ Why create plugins? ▪ IntelliJ Platform ▪ Demo ▪ What’s next? ▪ Q&A

Slide 4

Slide 4 text

Why plugins? ▪ Help new users get started with your library or framework ▪ Prevent routine errors or usage problems ▪ Automate repetitive tasks, eliminate boilerplate ▪ Assist migration between API versions ▪ Discover new (or better) API ▪ A challenge!

Slide 5

Slide 5 text

IntelliJ Platform ▪ A popular IDE among Scala developers ▪ Huge code base, written mostly in Java/Kotlin ▪ Everything is a plugin ▪ Almost everything is extensible ▪ Plugins can depend on other plugins ▪ Decent documentation IntelliJ Platform IDEA CE (Java, Kotlin, Groovy) PHP Support Ruby Support IDEA Ultimate PHP Storm RubyMine

Slide 6

Slide 6 text

Key IDE features ▪ Components and services ▪ Virtual File System (VFS) ▪ Language support (PSI) ▪ Code editor ▪ Inspections ▪ Code generators ▪ ...and much more https://github.com/JetBrains/intellij-community

Slide 7

Slide 7 text

PSI - Program Structure Interface IntelliJ’s representation of a program structure: • Syntax trees • Semantic information • Almost everything can be represented as a PsiElement • Every language implements its own PSI PsiElement PsiElement PsiElement PsiElement PsiFile PSI Tree

Slide 8

Slide 8 text

PSI - Base elements PSI model: • PsiElement • PsiWhiteSpace • PsiClass • PsiMethod • PsiField • … Can be inspected with Tools - View PSI Structure

Slide 9

Slide 9 text

PSI - Scala model PSI model: • ScTrait • ScParameterizedType • ScMethodCall • ScExpression • ScFunction • … Can be inspected with Tools - View PSI Structure

Slide 10

Slide 10 text

Let’s go!

Slide 11

Slide 11 text

More info and resources ▪ IntelliJ Platform SDK https://www.jetbrains.org/intellij/sdk/docs/intro/welcome.html ▪ Scala plugin https://github.com/JetBrains/intellij-scala ▪ SBT IDEA plugin https://github.com/JetBrains/sbt-idea-plugin ▪ HaskForce (Haskell plugin) https://github.com/carymrobbins/intellij-haskforce ▪ ZIO plugin for IntelliJ https://github.com/zio/zio-intellij ▪ IntelliJ Platform Slack https://jetbrains-platform.slack.com/

Slide 12

Slide 12 text

Thank You! Igal Tabachnik @hmemcpy