redacted-compiler-plugin icon indicating copy to clipboard operation
redacted-compiler-plugin copied to clipboard

IDE support

Open ZacSweers opened this issue 4 years ago • 10 comments

Not sure how this works but would be neat to support. Can look at the all-open (or similar) plugins for examples

https://github.com/JetBrains/kotlin/blob/master/plugins/allopen/allopen-ide

ZacSweers avatar Jan 24 '20 02:01 ZacSweers

It looks like this is somewhat straightforward!

ZacSweers avatar Jan 24 '20 05:01 ZacSweers

The iml facet has our plugin options in it

<option name="pluginOptions">
  <array>
    <option value="plugin:redacted-compiler-plugin:enabled=true" />
    <option value="plugin:redacted-compiler-plugin:replacementString=██" />
    <option value="plugin:redacted-compiler-plugin:redactedAnnotation=dev.zacsweers.redacted.sample.Redacted" />
  </array>
</option>

ZacSweers avatar Jan 24 '20 05:01 ZacSweers

Well, I take that back. Implementation-wise, it seems quite straightforward. However, Kotlin does not publish idea artifacts. This appears to be why all their external compilers move back to the main kotlin repo when they're productionized, as they rely on these private dependencies.

In short - seems like only first-party plugins are allowed to implement IDE support.

ZacSweers avatar Jan 24 '20 05:01 ZacSweers

One possible crazy idea - git submodule the kotlin repo and build against the idea APIs that way.

ZacSweers avatar Feb 03 '20 09:02 ZacSweers

Or clone the Kotlin repo and publish idea artifacts to maven yourself :) not sure about the legal implications though

romtsn avatar Mar 05 '20 21:03 romtsn

Yeah that's not something I'm going to do

ZacSweers avatar Mar 05 '20 21:03 ZacSweers

What does IDE support mean in this context? Will the IDE just use the full .toString() and that's the only downside?

ZakTaccardi avatar Feb 03 '22 18:02 ZakTaccardi

Basically just in decompiled bytecode

ZacSweers avatar Feb 03 '22 20:02 ZacSweers

This may be possible in FIR

ZacSweers avatar Jun 01 '22 16:06 ZacSweers

@ZacSweers it should be possible with FIR and you can test with a intellij community build, setting a registry key that allows non-official plugins to load.

see notes here: https://kotlinlang.slack.com/archives/C7L3JB43G/p1695407727213849

apatrida avatar Sep 22 '23 19:09 apatrida