Skip to content

Commit

Permalink
fix: use appropriate warning type preventing error inside Intellij `j…
Browse files Browse the repository at this point in the history
…ava.lang.NoClassDefFoundError: org/jetbrains/kotlin/com/intellij/psi/PsiElement` (#684)
  • Loading branch information
nicolasfara authored Jan 9, 2025
1 parent bc01d18 commit 86ece5e
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@

package it.unibo.collektive.frontend.checkers

import org.jetbrains.kotlin.com.intellij.psi.PsiElement
import org.jetbrains.kotlin.diagnostics.SourceElementPositioningStrategies.CALL_ELEMENT_WITH_DOT
import org.jetbrains.kotlin.diagnostics.rendering.RootDiagnosticRendererFactory
import org.jetbrains.kotlin.diagnostics.warning1
import org.jetbrains.kotlin.psi.KtNameReferenceExpression

/**
* Error messages for the Collektive compiler plugin.
Expand All @@ -20,18 +19,18 @@ object FirCollektiveErrors {
/**
* Warning raised when a forbidden function is called.
*/
val FORBIDDEN_FUNCTION_CALL by warning1<PsiElement, String>(CALL_ELEMENT_WITH_DOT)
val FORBIDDEN_FUNCTION_CALL by warning1<KtNameReferenceExpression, String>()

/**
* Warning raised when an aggregate function is called inside an iteration construct.
*/
val AGGREGATE_FUNCTION_INSIDE_ITERATION by warning1<PsiElement, String>(CALL_ELEMENT_WITH_DOT)
val AGGREGATE_FUNCTION_INSIDE_ITERATION by warning1<KtNameReferenceExpression, String>()

/**
* Warning raised when a function that has an aggregate parameter and uses it for making aggregate calls
* is called inside an iteration construct.
*/
val FUNCTION_WITH_AGGREGATE_PARAMETER_INSIDE_ITERATION by warning1<PsiElement, String>(CALL_ELEMENT_WITH_DOT)
val FUNCTION_WITH_AGGREGATE_PARAMETER_INSIDE_ITERATION by warning1<KtNameReferenceExpression, String>()

init {
RootDiagnosticRendererFactory.registerFactory(KtDefaultErrorMessagesCollektive)
Expand Down

0 comments on commit 86ece5e

Please sign in to comment.