KotlinPsiCheckerAndHighlightingUpdater: convert to Kotlin
This commit is contained in:
+8
-15
@@ -14,22 +14,15 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.jetbrains.kotlin.idea.highlighter;
|
package org.jetbrains.kotlin.idea.highlighter
|
||||||
|
|
||||||
import com.intellij.psi.PsiElement;
|
import org.jetbrains.kotlin.idea.inspections.UnusedSymbolInspection
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.kotlin.psi.KtNamedFunction
|
||||||
import org.jetbrains.kotlin.idea.inspections.UnusedSymbolInspection;
|
import org.jetbrains.kotlin.psi.KtParameter
|
||||||
import org.jetbrains.kotlin.psi.KtNamedFunction;
|
|
||||||
import org.jetbrains.kotlin.psi.KtParameter;
|
|
||||||
|
|
||||||
public class KotlinPsiCheckerAndHighlightingUpdater extends KotlinPsiChecker {
|
class KotlinPsiCheckerAndHighlightingUpdater : KotlinPsiChecker() {
|
||||||
@Override
|
override fun shouldSuppressUnusedParameter(parameter: KtParameter): Boolean {
|
||||||
protected boolean shouldSuppressUnusedParameter(@NotNull KtParameter parameter) {
|
val grandParent = parameter.parent.parent
|
||||||
PsiElement grandParent = parameter.getParent().getParent();
|
return if (grandParent is KtNamedFunction) UnusedSymbolInspection.isEntryPoint(grandParent) else false
|
||||||
if (grandParent instanceof KtNamedFunction) {
|
|
||||||
KtNamedFunction function = (KtNamedFunction) grandParent;
|
|
||||||
return UnusedSymbolInspection.Companion.isEntryPoint(function);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user