mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
LVTI: provide quick documentation with type info for var types
This commit is contained in:
+27
@@ -0,0 +1,27 @@
|
||||
// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.codeInsight.navigation.actions;
|
||||
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import com.intellij.psi.PsiIdentifier;
|
||||
import com.intellij.psi.PsiTypeElement;
|
||||
import com.intellij.psi.PsiVariable;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class GotoVarTypeHandler extends GotoDeclarationHandlerBase {
|
||||
@Override
|
||||
@Nullable
|
||||
public PsiElement getGotoDeclarationTarget(@Nullable PsiElement elementAt, Editor editor) {
|
||||
if (elementAt instanceof PsiIdentifier) {
|
||||
PsiElement parent = elementAt.getParent();
|
||||
if (parent instanceof PsiVariable) {
|
||||
PsiTypeElement typeElement = ((PsiVariable)parent).getTypeElement();
|
||||
if (typeElement != null && typeElement.isInferredType()) {
|
||||
return parent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1952,6 +1952,7 @@
|
||||
<annotator language="SPI" implementationClass="com.intellij.spi.SPIAnnotator"/>
|
||||
|
||||
<gotoDeclarationHandler implementation="com.intellij.codeInsight.navigation.actions.GotoLambdaParameterHandler"/>
|
||||
<gotoDeclarationHandler implementation="com.intellij.codeInsight.navigation.actions.GotoVarTypeHandler"/>
|
||||
|
||||
<completion.contributor language="JAVA" id="methodsChainsCompletionContributor" order="first"
|
||||
implementationClass="com.intellij.compiler.chainsSearch.completion.MethodChainCompletionContributor"/>
|
||||
|
||||
Reference in New Issue
Block a user