Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing extension point: org.jetbrains.kotlin.com.intellij.treeCopyHandler #4500

Closed
Jamalam360 opened this issue Jan 18, 2022 · 8 comments · Fixed by #4545
Closed

Missing extension point: org.jetbrains.kotlin.com.intellij.treeCopyHandler #4500

Jamalam360 opened this issue Jan 18, 2022 · 8 comments · Fixed by #4545

Comments

@Jamalam360
Copy link

Expected Behavior

Executing ./gradlew detekt should not fail with this exception.

Observed Behavior

PS C:\Users\James\Desktop\Development\Discord\Pinguino> .\gradlew detekt
Type-safe dependency accessors is an incubating feature.

> Task :detekt
Property 'potential-bugs>LateinitUsage>excludeAnnotatedProperties' is deprecated. Use `ignoreAnnotated` instead.
Property 'style>FunctionOnlyReturningConstant>excludeAnnotatedFunction' is deprecated. Use `ignoreAnnotated` instead.
Property 'style>UnderscoresInNumericLiterals>acceptableDecimalLength' is deprecated. Use `acceptableLength` instead.
Property 'style>UnnecessaryAbstractClass>excludeAnnotatedClasses' is deprecated. Use `ignoreAnnotated` instead.
Property 'style>UseDataClass>excludeAnnotatedClasses' is deprecated. Use `ignoreAnnotated` instead.

> Task :detekt FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':detekt'.
> Analyzing C:\Users\James\Desktop\Development\Discord\Pinguino\src\main\kotlin\io\github\jamalam360\extensions\moderation\ModerationExtension.kt led to an exception.
  The original exception message was: Missing extension point: org.jetbrains.kotlin.com.intellij.treeCopyHandler in container org.jetbrains.kotlin.com.intellij.core.CoreApplicationEnvironment$1@11d4e8cb
  Running detekt '1.19.0' on Java '17+35' on OS 'Windows 10'
  If the exception message does not help, please feel free to create an issue on our GitHub page.

Steps to Reproduce

Run ./gradlew detekt in the repository linked below

Context

Trying to simply run Detekt. It worked up till a point then it seemed to just break.

Your Environment

  • Java 17
  • Version of detekt used: 1.19.0
  • Version of Gradle used (if applicable): 7.3
  • Gradle scan link (add --scan option when running the gradle task): It contains my IRL name, I'd prefer not to share that. If somebody can tell me how to remove that from the scan I can send it if necessary
  • Windows 10
  • Source Code
@Jamalam360 Jamalam360 added the bug label Jan 18, 2022
@BraisGabin
Copy link
Member

It seems related with #4489

@Jamalam360
Copy link
Author

Looks like it. Unfortunately I don't have a reproduction because this started happening a couple weeks ago but I had to fix other things in my code first, so I'm not sure what change caused the issue

@cortinico
Copy link
Member

Java 17

Could you give a try with other JDKs?
Also it seems like that without a reproducer it's hard to sort this out.

@cortinico
Copy link
Member

I've spent some time investigating this. That's essentially another instance of #4003

@Jamalam360
Copy link
Author

The same issue occurs with JDK 15. Thank you for investigating this

@pocmo
Copy link
Contributor

pocmo commented Feb 1, 2022

I've been running into the Missing extension point exception too with autoCorrect = true enabled.

I tested the patch from PR #4545. But now I am getting a different exception:

java.lang.IllegalStateException: Analyzing //some file with extension functions// led to an exception.
The original exception message was: java.lang.ClassCastException: class org.jetbrains.kotlin.kdoc.psi.impl.KDocImpl cannot be cast to class org.jetbrains.kotlin.com.intellij.psi.impl.source.tree.LeafPsiElement (org.jetbrains.kotlin.kdoc.psi.impl.KDocImpl and org.jetbrains.kotlin.com.intellij.psi.impl.source.tree.LeafPsiElement are in unnamed module of loader java.net.URLClassLoader @4be333f9)
Running detekt '//my own build//' on Java '11.0.11+9' on OS 'Mac OS X'

@cortinico
Copy link
Member

I tested the patch from PR #4545. But now I am getting a different exception:

In order to look into this we would need:

  • The full stacktrace (a run with --stacktrace).
  • A reproducer (at least the snippet of code that is causing the issue).

I'm also leaning towards that being an issue with KtLint: https://github.com/pinterest/ktlint/issues?q=ClassCastException

@Jamalam360
Copy link
Author

Can confirm, working in 1.20.0-RC1. Now to fix alllllll the issues that built up while it wasn't working 🤡

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants