title: Debug Scala compiler plugin in IntelliJ IDEA
body: <p>I would like to write my compiler plugin for <em>scalac</em>, but I get a problem in early state in development because I cannot run and debug my code from IntelliJ IDEA.</p>
  
  <p>I use these tutorials for implementing a dummy plugin:</p>
  
  <ul>
  <li><a href="https://github.com/jrudolph/scalac-plugin.g8" rel="nofollow">Scalac plugin template</a></li>
  <li><a href="http://www.scala-lang.org/old/node/140" rel="nofollow">An old post from scala-lang.org</a></li>
  </ul>
  
  <p>My goal is to run my plugin somehow in debug mode in IDEA to encounter breakpoints.</p>
  
  <p><strong>Update:</strong></p>
  
  <p>The answer below helped me a lot but actually, I added arguments for debugging for <em>JAVA_OPTS</em> environment variable with suspending until remote debugger connection option. Then I started <em>scalac</em> and run remote debugger described below.</p>