mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Fix: IDEA-66455 (Provide documentation for GSP tags)
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.intellij.psi.impl.light;
|
||||
|
||||
import com.intellij.lang.Language;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.impl.ElementPresentationUtil;
|
||||
@@ -38,7 +39,11 @@ public abstract class LightVariableBase extends LightElement implements PsiVaria
|
||||
protected boolean myWritable;
|
||||
|
||||
public LightVariableBase(PsiManager manager, PsiIdentifier nameIdentifier, PsiType type, boolean writable, PsiElement scope) {
|
||||
super(manager, StdFileTypes.JAVA.getLanguage());
|
||||
this(manager, nameIdentifier, StdFileTypes.JAVA.getLanguage(), type, writable, scope);
|
||||
}
|
||||
|
||||
public LightVariableBase(PsiManager manager, PsiIdentifier nameIdentifier, Language language, PsiType type, boolean writable, PsiElement scope) {
|
||||
super(manager, language);
|
||||
myModifierList = new LightModifierList(myManager);
|
||||
myNameIdentifier = nameIdentifier;
|
||||
myWritable = writable;
|
||||
|
||||
+22
@@ -27,6 +27,7 @@ import com.intellij.lang.java.JavaDocumentationProvider;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.impl.compiled.ClsFileImpl;
|
||||
import com.intellij.psi.impl.source.javadoc.PsiDocParamRef;
|
||||
import com.intellij.psi.javadoc.PsiDocComment;
|
||||
import com.intellij.psi.javadoc.PsiDocTag;
|
||||
@@ -49,8 +50,10 @@ import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpres
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrReferenceExpression;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.params.GrParameter;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.GrTypeDefinition;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrAccessorMethod;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrGdkMethod;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrMethod;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.impl.synthetic.GrLightVariable;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.util.PsiUtil;
|
||||
|
||||
import java.util.List;
|
||||
@@ -286,6 +289,25 @@ public class GroovyDocumentationProvider implements CodeDocumentationProvider, E
|
||||
element = GrDocCommentUtil.findDocOwner(doc);
|
||||
}
|
||||
|
||||
if (element instanceof GrLightVariable) {
|
||||
PsiElement navigationElement = element.getNavigationElement();
|
||||
|
||||
if (navigationElement != null) {
|
||||
element = navigationElement;
|
||||
|
||||
if (element.getContainingFile() instanceof ClsFileImpl) {
|
||||
navigationElement = element.getNavigationElement();
|
||||
if (navigationElement != null) {
|
||||
element = navigationElement;
|
||||
}
|
||||
}
|
||||
|
||||
if (element instanceof GrAccessorMethod) {
|
||||
element = ((GrAccessorMethod)element).getProperty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return JavaDocumentationProvider.generateExternalJavadoc(element);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ import org.jetbrains.plugins.groovy.lang.psi.api.statements.params.GrParameter;
|
||||
/**
|
||||
* @author ven
|
||||
*/
|
||||
public class ClosureSyntheticParameter extends GrLightParameter implements NavigationItem {
|
||||
public class ClosureSyntheticParameter extends GrLightParameter implements NavigationItem, GrRenamedLightElement {
|
||||
private final GrClosableBlock myClosure;
|
||||
|
||||
public ClosureSyntheticParameter(GrClosableBlock closure) {
|
||||
|
||||
+1
-1
@@ -22,5 +22,5 @@ import com.intellij.psi.PsiVariable;
|
||||
* User: Dmitry.Krasilschikov
|
||||
* Date: 04.02.2008
|
||||
*/
|
||||
public interface GrImplicitVariable extends PsiVariable, NavigatablePsiElement {
|
||||
public interface GrImplicitVariable extends PsiVariable, NavigatablePsiElement, GrRenamedLightElement {
|
||||
}
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@ import com.intellij.psi.impl.light.LightVariableBase;
|
||||
import com.intellij.util.IncorrectOperationException;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.plugins.groovy.GroovyFileType;
|
||||
|
||||
/**
|
||||
* @author ilyas
|
||||
@@ -16,7 +16,7 @@ public class GrImplicitVariableImpl extends LightVariableBase implements GrImpli
|
||||
private PsiModifierList myInnerModifierList;
|
||||
|
||||
public GrImplicitVariableImpl(PsiModifierList modifierList, PsiManager manager, PsiIdentifier nameIdentifier, @NotNull PsiType type, boolean writable, PsiElement scope) {
|
||||
super(manager, nameIdentifier, type, writable, scope);
|
||||
super(manager, nameIdentifier, GroovyFileType.GROOVY_LANGUAGE, type, writable, scope);
|
||||
myInnerModifierList = modifierList != null ? modifierList : myModifierList;
|
||||
}
|
||||
|
||||
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package org.jetbrains.plugins.groovy.lang.psi.impl.synthetic;
|
||||
|
||||
/**
|
||||
* @author Sergey Evdokimov
|
||||
*/
|
||||
public interface GrRenamedLightElement {
|
||||
}
|
||||
+2
-2
@@ -25,7 +25,7 @@ import com.intellij.refactoring.util.CommonRefactoringUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.plugins.groovy.GroovyFileType;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.impl.synthetic.ClosureSyntheticParameter;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.impl.synthetic.GrRenamedLightElement;
|
||||
import org.jetbrains.plugins.groovy.refactoring.GroovyRefactoringBundle;
|
||||
|
||||
/**
|
||||
@@ -44,7 +44,7 @@ public class GrLightElementRenamer extends RenamePsiElementProcessor {
|
||||
@Override
|
||||
public boolean canProcessElement(@NotNull PsiElement element) {
|
||||
if (!(element instanceof LightElement)) return false;
|
||||
if (element instanceof ClosureSyntheticParameter) return false;
|
||||
if (element instanceof GrRenamedLightElement) return false;
|
||||
final Language language = element.getLanguage();
|
||||
return GroovyFileType.GROOVY_LANGUAGE.equals(language);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user