aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorakosyakov2013-07-02 13:56:39 (EDT)
committerJan Koehnlein2013-07-08 10:40:37 (EDT)
commitf3df5d844e253cce28f3ad164cbbcb2b875c2e8d (patch)
treed717a15a4077adf87e2342d8e9c064e86a9f48b5
parent1805128bcc91e53604dfc1d83ecfd0fbd69b48b2 (diff)
downloadorg.eclipse.xtext-f3df5d844e253cce28f3ad164cbbcb2b875c2e8d.zip
org.eclipse.xtext-f3df5d844e253cce28f3ad164cbbcb2b875c2e8d.tar.gz
org.eclipse.xtext-f3df5d844e253cce28f3ad164cbbcb2b875c2e8d.tar.bz2
[Bug 408935]: resolved - the javadow window show the generated javadocrefs/changes/01/14201/4
instead of declared in Xtend Merged manually as rebase on gerrit didn't work Change-Id: I3c2b09471cb15c446e4b0d5dca818005c08f031d Signed-off-by: akosyakov <anton.kosyakov@itemis.de>
-rw-r--r--plugins/org.eclipse.xtend.ide/src/org/eclipse/xtend/ide/hover/XtendHoverDocumentationProvider.java77
-rw-r--r--plugins/org.eclipse.xtext.xbase.ui/src/org/eclipse/xtext/xbase/ui/hover/XbaseHoverDocumentationProvider.java186
-rw-r--r--tests/org.eclipse.xtend.ide.tests/src/org/eclipse/xtend/ide/tests/macros/ActiveAnnotationsProcessingInIDETest.xtend2
-rw-r--r--tests/org.eclipse.xtend.ide.tests/xtend-gen/org/eclipse/xtend/ide/tests/macros/ActiveAnnotationsProcessingInIDETest.java2
4 files changed, 156 insertions, 111 deletions
diff --git a/plugins/org.eclipse.xtend.ide/src/org/eclipse/xtend/ide/hover/XtendHoverDocumentationProvider.java b/plugins/org.eclipse.xtend.ide/src/org/eclipse/xtend/ide/hover/XtendHoverDocumentationProvider.java
index 1671ef5..87eca9b 100644
--- a/plugins/org.eclipse.xtend.ide/src/org/eclipse/xtend/ide/hover/XtendHoverDocumentationProvider.java
+++ b/plugins/org.eclipse.xtend.ide/src/org/eclipse/xtend/ide/hover/XtendHoverDocumentationProvider.java
@@ -11,6 +11,7 @@ import static org.eclipse.xtext.xbase.ui.hover.HoverLinkHelper.*;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.URI;
@@ -34,6 +35,7 @@ import org.eclipse.xtext.ui.editor.hover.html.XtextElementLinks;
import org.eclipse.xtext.xbase.annotations.xAnnotations.XAnnotation;
import org.eclipse.xtext.xbase.annotations.xAnnotations.XAnnotationElementValuePair;
import org.eclipse.xtext.xbase.annotations.xAnnotations.XAnnotationsPackage;
+import org.eclipse.xtext.xbase.compiler.DocumentationAdapter;
import org.eclipse.xtext.xbase.ui.hover.XbaseHoverDocumentationProvider;
import com.google.common.collect.Lists;
@@ -45,7 +47,7 @@ import com.google.inject.Inject;
*/
@SuppressWarnings("deprecation")
public class XtendHoverDocumentationProvider extends XbaseHoverDocumentationProvider {
-
+
@Inject
private IXtendJvmAssociations associations;
@@ -63,17 +65,19 @@ public class XtendHoverDocumentationProvider extends XbaseHoverDocumentationProv
@Override
protected void addAnnotations(EObject object) {
- if(object instanceof XtendAnnotationTarget){
- for(XAnnotation annotation : ((XtendAnnotationTarget) object).getAnnotations()){
+ if (object instanceof XtendAnnotationTarget) {
+ for (XAnnotation annotation : ((XtendAnnotationTarget) object).getAnnotations()) {
JvmType annotationType = annotation.getAnnotationType();
- if(annotationType != null && !annotationType.eIsProxy() && annotationType instanceof JvmAnnotationType) {
+ if (annotationType != null && !annotationType.eIsProxy() && annotationType instanceof JvmAnnotationType) {
buffer.append("@");
- buffer.append(createLinkWithLabel(XtextElementLinks.XTEXTDOC_SCHEME, EcoreUtil.getURI(annotationType), annotation.getAnnotationType().getSimpleName()));
+ buffer.append(createLinkWithLabel(XtextElementLinks.XTEXTDOC_SCHEME,
+ EcoreUtil.getURI(annotationType), annotation.getAnnotationType().getSimpleName()));
EList<XAnnotationElementValuePair> elementValuePairs = annotation.getElementValuePairs();
- if(elementValuePairs.size() > 0){
+ if (elementValuePairs.size() > 0) {
buffer.append("(");
- List<INode> findNodesForFeature = NodeModelUtils.findNodesForFeature(annotation, XAnnotationsPackage.eINSTANCE.getXAnnotation_ElementValuePairs());
- if(findNodesForFeature.size() > 0)
+ List<INode> findNodesForFeature = NodeModelUtils.findNodesForFeature(annotation,
+ XAnnotationsPackage.eINSTANCE.getXAnnotation_ElementValuePairs());
+ if (findNodesForFeature.size() > 0)
buffer.append(findNodesForFeature.get(0).getText());
buffer.append(")");
}
@@ -84,7 +88,7 @@ public class XtendHoverDocumentationProvider extends XbaseHoverDocumentationProv
super.addAnnotations(object);
}
}
-
+
@Override
protected void handleSuperMethodReferences(EObject context) {
if (context instanceof XtendFunction) {
@@ -100,17 +104,17 @@ public class XtendHoverDocumentationProvider extends XbaseHoverDocumentationProv
}
}
}
-
+
@Override
protected List<String> initParameterNames() {
List<String> result = super.initParameterNames();
- if(context instanceof XtendFunction){
- for(XtendParameter param : ((XtendFunction) context).getParameters()){
+ if (context instanceof XtendFunction) {
+ for (XtendParameter param : ((XtendFunction) context).getParameters()) {
result.add(param.getName());
}
}
- if(context instanceof XtendConstructor){
- for(XtendParameter param : ((XtendConstructor) context).getParameters()){
+ if (context instanceof XtendConstructor) {
+ for (XtendParameter param : ((XtendConstructor) context).getParameters()) {
result.add(param.getName());
}
}
@@ -118,34 +122,59 @@ public class XtendHoverDocumentationProvider extends XbaseHoverDocumentationProv
}
@Override
- protected Map<String,URI> initExceptionNamesToURI() {
- Map<String,URI> result = super.initExceptionNamesToURI();
- if(context instanceof XtendFunction){
- for(JvmTypeReference exception : ((XtendFunction) context).getExceptions()){
+ protected Map<String, URI> initExceptionNamesToURI() {
+ Map<String, URI> result = super.initExceptionNamesToURI();
+ if (context instanceof XtendFunction) {
+ for (JvmTypeReference exception : ((XtendFunction) context).getExceptions()) {
result.put(exception.getSimpleName(), EcoreUtil.getURI(exception.getType()));
}
}
- if(context instanceof XtendConstructor){
- for(JvmTypeReference exception : ((XtendConstructor) context).getExceptions()){
+ if (context instanceof XtendConstructor) {
+ for (JvmTypeReference exception : ((XtendConstructor) context).getExceptions()) {
result.put(exception.getSimpleName(), EcoreUtil.getURI(exception.getType()));
}
}
return result;
}
-
+
@Override
protected List<EObject> getFilteredDerivedElements(EObject o, EClass type) {
List<EObject> filteredDerivedElements = super.getFilteredDerivedElements(o, type);
- if(filteredDerivedElements.size() > 1)
+ if (filteredDerivedElements.size() > 1)
return filteredDerivedElements;
return Lists.newArrayList();
}
-
+
@Override
protected List<EObject> getFilteredSourceElements(EObject o, EClass type) {
List<EObject> filteredSourceElements = super.getFilteredSourceElements(o, type);
- if(filteredSourceElements.size() > 1)
+ if (filteredSourceElements.size() > 1)
return filteredSourceElements;
return Lists.newArrayList();
}
+
+ @Override
+ protected String resolveDocumentation(EObject sourceElement) {
+ Set<EObject> jvmElements = associations.getJvmElements(sourceElement);
+ if (jvmElements == null) {
+ return super.resolveDocumentation(sourceElement);
+ }
+ for (EObject jvmElement : jvmElements) {
+ String documentation = resolveDocumentationForJvmElement(jvmElement);
+ if (documentation != null) {
+ return documentation;
+ }
+ }
+ return super.resolveDocumentation(sourceElement);
+ }
+
+ protected String resolveDocumentationForJvmElement(EObject jvmElement) {
+ String documentation = documentationProvider.getDocumentation(jvmElement);
+ if (documentation != null) {
+ return documentation;
+ }
+ DocumentationAdapter adapter = getDocumentationAdapter(jvmElement);
+ return adapter == null ? null : adapter.getDocumentation();
+ }
+
}
diff --git a/plugins/org.eclipse.xtext.xbase.ui/src/org/eclipse/xtext/xbase/ui/hover/XbaseHoverDocumentationProvider.java b/plugins/org.eclipse.xtext.xbase.ui/src/org/eclipse/xtext/xbase/ui/hover/XbaseHoverDocumentationProvider.java
index 7f3e1e6..e803f2e 100644
--- a/plugins/org.eclipse.xtext.xbase.ui/src/org/eclipse/xtext/xbase/ui/hover/XbaseHoverDocumentationProvider.java
+++ b/plugins/org.eclipse.xtext.xbase.ui/src/org/eclipse/xtext/xbase/ui/hover/XbaseHoverDocumentationProvider.java
@@ -84,7 +84,7 @@ import com.google.inject.Inject;
* @author Holger Schill - Initial contribution and API
* @since 2.3
*/
-public class XbaseHoverDocumentationProvider implements IEObjectHoverDocumentationProvider{
+public class XbaseHoverDocumentationProvider implements IEObjectHoverDocumentationProvider {
protected static final String BLOCK_TAG_START = "<dl>"; //$NON-NLS-1$
protected static final String BLOCK_TAG_END = "</dl>"; //$NON-NLS-1$
protected static final String BlOCK_TAG_ENTRY_START = "<dd>"; //$NON-NLS-1$
@@ -107,7 +107,8 @@ public class XbaseHoverDocumentationProvider implements IEObjectHoverDocumentati
protected JvmModelGenerator jvmModelGenerator;
@Inject
private XbaseDeclarativeHoverSignatureProvider hoverSignatureProvider;
- @Inject IGeneratorConfigProvider generatorConfigProvider;
+ @Inject
+ IGeneratorConfigProvider generatorConfigProvider;
protected StringBuffer buffer;
protected int fLiteralContent;
@@ -117,13 +118,13 @@ public class XbaseHoverDocumentationProvider implements IEObjectHoverDocumentati
public String getDocumentation(EObject object) {
return computeDocumentation(object) + getDerivedOrOriginalDeclarationInformation(object);
}
-
- public String computeDocumentation(EObject object){
+
+ public String computeDocumentation(EObject object) {
buffer = new StringBuffer();
context = object;
fLiteralContent = 0;
List<String> parameterNames = initParameterNames();
- Map<String,URI> exceptionNamesToURI = initExceptionNamesToURI();
+ Map<String, URI> exceptionNamesToURI = initExceptionNamesToURI();
addAnnotations(object);
getDocumentationWithPrefix(object);
Javadoc javadoc = getJavaDoc();
@@ -166,13 +167,13 @@ public class XbaseHoverDocumentationProvider implements IEObjectHoverDocumentati
} else if (TagElement.TAG_EXCEPTION.equals(tagName) || TagElement.TAG_THROWS.equals(tagName)) {
exceptions.add(tag);
@SuppressWarnings("unchecked")
- List<? extends ASTNode> fragments= tag.fragments();
+ List<? extends ASTNode> fragments = tag.fragments();
if (fragments.size() > 0) {
- Object first= fragments.get(0);
+ Object first = fragments.get(0);
if (first instanceof Name) {
- String name= ASTNodes.getSimpleNameIdentifier((Name) first);
- if (exceptionNamesToURI.containsKey(name) ) {
- exceptionNamesToURI.put(name,null);
+ String name = ASTNodes.getSimpleNameIdentifier((Name) first);
+ if (exceptionNamesToURI.containsKey(name)) {
+ exceptionNamesToURI.put(name, null);
}
}
}
@@ -208,7 +209,7 @@ public class XbaseHoverDocumentationProvider implements IEObjectHoverDocumentati
&& (parameterNames.size() > 0 || exceptionNamesToURI.size() > 0)) {
handleSuperMethodReferences(object);
buffer.append(BLOCK_TAG_START);
- handleParameters(object, parameters,parameterNames);
+ handleParameters(object, parameters, parameterNames);
handleReturnTag(returnTag);
handleExceptionTags(exceptions, exceptionNamesToURI);
handleBlockTags("Since:", since);
@@ -226,10 +227,10 @@ public class XbaseHoverDocumentationProvider implements IEObjectHoverDocumentati
context = null;
return result;
}
-
- public String getDerivedOrOriginalDeclarationInformation(EObject object){
+
+ public String getDerivedOrOriginalDeclarationInformation(EObject object) {
String derivedInformation = getDerivedElementInformation(object);
- if(derivedInformation != null && derivedInformation.length() > 0)
+ if (derivedInformation != null && derivedInformation.length() > 0)
return getDerivedElementInformation(object);
return getOriginalDeclarationInformation(object);
}
@@ -244,8 +245,8 @@ public class XbaseHoverDocumentationProvider implements IEObjectHoverDocumentati
return result;
}
- protected Map<String,URI> initExceptionNamesToURI() {
- Map<String,URI> result = Maps.newHashMap();
+ protected Map<String, URI> initExceptionNamesToURI() {
+ Map<String, URI> result = Maps.newHashMap();
if (context instanceof JvmExecutable) {
for (JvmTypeReference exception : ((JvmExecutable) context).getExceptions()) {
result.put(exception.getSimpleName(), EcoreUtil.getURI(exception.getType()));
@@ -262,8 +263,9 @@ public class XbaseHoverDocumentationProvider implements IEObjectHoverDocumentati
EList<JvmAnnotationReference> annotations = ((JvmAnnotationTarget) associatedElement).getAnnotations();
for (JvmAnnotationReference annotationReference : annotations) {
buffer.append("@");
- buffer.append(createLinkWithLabel(XtextElementLinks.XTEXTDOC_SCHEME, EcoreUtil.getURI(annotationReference.getAnnotation()),
- annotationReference.getAnnotation().getSimpleName()));
+ buffer.append(createLinkWithLabel(XtextElementLinks.XTEXTDOC_SCHEME, EcoreUtil
+ .getURI(annotationReference.getAnnotation()), annotationReference.getAnnotation()
+ .getSimpleName()));
if (annotationReference.getValues().size() > 0) {
buffer.append("(");
for (JvmAnnotationValue value : annotationReference.getValues()) {
@@ -285,19 +287,10 @@ public class XbaseHoverDocumentationProvider implements IEObjectHoverDocumentati
protected void getDocumentationWithPrefix(EObject object) {
String startTag = "/**";
String endTag = "*/";
- ILineSeparatorInformation lineSeparatorInformation = whitespaceInformationProvider.getLineSeparatorInformation(EcoreUtil.getURI(object));
+ ILineSeparatorInformation lineSeparatorInformation = whitespaceInformationProvider
+ .getLineSeparatorInformation(EcoreUtil.getURI(object));
String lineBreak = lineSeparatorInformation.getLineSeparator();
- String documentation = documentationProvider.getDocumentation(object);
- if (documentation == null) {
- DocumentationAdapter adapter = (DocumentationAdapter) EcoreUtil.getAdapter(object.eAdapters(),
- DocumentationAdapter.class);
- if (adapter != null)
- documentation = adapter.getDocumentation();
- EObject primarySourceElement = associations.getPrimarySourceElement(object);
- if (primarySourceElement != null)
- documentation = documentationProvider.getDocumentation(primarySourceElement);
- }
-
+ String documentation = resolveDocumentation(object);
if (documentation != null && documentation.length() > 0) {
BufferedReader reader = new BufferedReader(new StringReader(documentation));
StringBuilder builder = new StringBuilder(startTag + lineBreak);
@@ -315,6 +308,29 @@ public class XbaseHoverDocumentationProvider implements IEObjectHoverDocumentati
}
}
+ protected String resolveDocumentation(EObject object) {
+ String documentation = documentationProvider.getDocumentation(object);
+ if (documentation != null) {
+ return documentation;
+ }
+ DocumentationAdapter adapter = getDocumentationAdapter(object);
+ if (adapter != null) {
+ documentation = adapter.getDocumentation();
+ }
+ if (documentation != null) {
+ return documentation;
+ }
+ EObject primarySourceElement = associations.getPrimarySourceElement(object);
+ if (primarySourceElement == null) {
+ return null;
+ }
+ return documentationProvider.getDocumentation(primarySourceElement);
+ }
+
+ protected DocumentationAdapter getDocumentationAdapter(EObject object) {
+ return (DocumentationAdapter) EcoreUtil.getAdapter(object.eAdapters(), DocumentationAdapter.class);
+ }
+
protected void handleSuperMethodReferences(EObject context) {
// Not handled for Xbase
}
@@ -379,15 +395,17 @@ public class XbaseHoverDocumentationProvider implements IEObjectHoverDocumentati
int hashIndex = firstFragment.indexOf("#");
if (hashIndex != -1) {
JvmDeclaredType resolvedDeclarator = getResolvedDeclarator(firstFragment.substring(0, hashIndex));
- if (resolvedDeclarator!= null && !resolvedDeclarator.eIsProxy()) {
+ if (resolvedDeclarator != null && !resolvedDeclarator.eIsProxy()) {
String signature = firstFragment.substring(hashIndex + 1);
int indexOfOpenBracket = signature.indexOf("(");
int indexOfClosingBracket = signature.indexOf(")");
- String simpleNameOfFeature = indexOfOpenBracket != -1 ? signature.substring(0, indexOfOpenBracket) : signature;
+ String simpleNameOfFeature = indexOfOpenBracket != -1 ? signature.substring(0, indexOfOpenBracket)
+ : signature;
Iterable<JvmFeature> possibleCandidates = resolvedDeclarator.findAllFeaturesByName(simpleNameOfFeature);
List<String> parameterNames = null;
if (indexOfOpenBracket != -1 && indexOfClosingBracket != -1) {
- parameterNames = Strings.split(signature.substring(indexOfOpenBracket + 1, indexOfClosingBracket), ",");
+ parameterNames = Strings.split(signature.substring(indexOfOpenBracket + 1, indexOfClosingBracket),
+ ",");
}
Iterator<JvmFeature> featureIterator = possibleCandidates.iterator();
while (elementURI == null && featureIterator.hasNext()) {
@@ -403,8 +421,7 @@ public class XbaseHoverDocumentationProvider implements IEObjectHoverDocumentati
} else if (parameters.size() == parameterNames.size()) {
valid = true;
for (int i = 0; (i < parameterNames.size() && valid); i++) {
- URI parameterTypeURI = EcoreUtil
- .getURI(parameters.get(i).getParameterType().getType());
+ URI parameterTypeURI = EcoreUtil.getURI(parameters.get(i).getParameterType().getType());
IEObjectDescription expectedParameter = scopeProvider.getScope(context,
new HoverReference(TypesPackage.Literals.JVM_TYPE)).getSingleElement(
qualifiedNameConverter.toQualifiedName(parameterNames.get(i)));
@@ -427,14 +444,14 @@ public class XbaseHoverDocumentationProvider implements IEObjectHoverDocumentati
elementURI = singleElement.getEObjectURI();
}
String label = "";
- if(fragments.size() > 1){
- for(int i = 1 ; i < fragments.size() ; i++){
+ if (fragments.size() > 1) {
+ for (int i = 1; i < fragments.size(); i++) {
String portentialLabel = fragments.get(i).toString();
- if(portentialLabel.trim().length() > 0)
- label += portentialLabel;
+ if (portentialLabel.trim().length() > 0)
+ label += portentialLabel;
}
}
- if(label.length() == 0)
+ if (label.length() == 0)
label = firstFragment;
if (elementURI == null)
buffer.append(label);
@@ -511,18 +528,19 @@ public class XbaseHoverDocumentationProvider implements IEObjectHoverDocumentati
handleThrowsTag(tag);
buffer.append(BlOCK_TAG_ENTRY_END);
}
- for (int i= 0; i < exceptionNamesToURI.size(); i++) {
- String name= Lists.newArrayList(exceptionNamesToURI.keySet()).get(i);
+ for (int i = 0; i < exceptionNamesToURI.size(); i++) {
+ String name = Lists.newArrayList(exceptionNamesToURI.keySet()).get(i);
if (name != null && exceptionNamesToURI.get(name) != null) {
buffer.append(BlOCK_TAG_ENTRY_START);
- buffer.append(createLinkWithLabel(XtextElementLinks.XTEXTDOC_SCHEME, exceptionNamesToURI.get(name), name));
+ buffer.append(createLinkWithLabel(XtextElementLinks.XTEXTDOC_SCHEME, exceptionNamesToURI.get(name),
+ name));
buffer.append(BlOCK_TAG_ENTRY_END);
}
}
}
-
+
private boolean containsOnlyNull(Collection<?> list) {
- for (Iterator<?> iter= list.iterator(); iter.hasNext(); ) {
+ for (Iterator<?> iter = list.iterator(); iter.hasNext();) {
if (iter.next() != null)
return false;
}
@@ -611,8 +629,7 @@ public class XbaseHoverDocumentationProvider implements IEObjectHoverDocumentati
@SuppressWarnings("unchecked")
List<ASTNode> fragments = node.fragments();
handleContentElements(fragments, true);
- }
- else if (handleInheritDoc(node)) {
+ } else if (handleInheritDoc(node)) {
// handled
} else if (handleDocRoot(node)) {
// handled
@@ -684,9 +701,9 @@ public class XbaseHoverDocumentationProvider implements IEObjectHoverDocumentati
handleParamTag(tag);
buffer.append(BlOCK_TAG_ENTRY_END);
}
-
- for (int i= 0; i < parameterNames.size(); i++) {
- String name= parameterNames.get(i);
+
+ for (int i = 0; i < parameterNames.size(); i++) {
+ String name = parameterNames.get(i);
if (name != null) {
buffer.append(BlOCK_TAG_ENTRY_START);
buffer.append(PARAM_NAME_START);
@@ -780,64 +797,67 @@ public class XbaseHoverDocumentationProvider implements IEObjectHoverDocumentati
}
return null;
}
-
+
protected String getDerivedElementInformation(EObject o) {
StringBuffer buf = new StringBuffer();
List<EObject> jvmElements = getFilteredDerivedElements(o, TypesPackage.Literals.JVM_MEMBER);
- if(jvmElements.size() > 0){
+ if (jvmElements.size() > 0) {
buf.append("<dt>Derived element:</dt>");
- for(EObject jvmElement : jvmElements){
- buf.append("<dd>");
- buf.append(computeLinkToElement(jvmElement));
- buf.append("</dd>");
+ for (EObject jvmElement : jvmElements) {
+ buf.append("<dd>");
+ buf.append(computeLinkToElement(jvmElement));
+ buf.append("</dd>");
}
}
return buf.toString();
}
-
- protected String getOriginalDeclarationInformation(EObject o){
+
+ protected String getOriginalDeclarationInformation(EObject o) {
StringBuffer buf = new StringBuffer();
List<EObject> sourceElements = getFilteredSourceElements(o, null);
- if(sourceElements.size() > 0){
+ if (sourceElements.size() > 0) {
buf.append("<dt>Original declaration:</dt>");
- for(EObject sourceElement: sourceElements){
+ for (EObject sourceElement : sourceElements) {
buf.append("<dd>");
- buf.append(computeLinkToElement(sourceElement));
+ buf.append(computeLinkToElement(sourceElement));
buf.append("</dd>");
- }
+ }
}
return buf.toString();
}
-
+
protected List<EObject> getFilteredDerivedElements(EObject o, final EClass type) {
- List<EObject> jvmElements = Lists.newArrayList(Iterables.filter(associations.getJvmElements(o), new Predicate<EObject>() {
- public boolean apply(EObject input) {
- if(input instanceof JvmConstructor && ((JvmConstructor) input).getParameters().size() == 0)
- return false;
- if(type == null)
- return true;
- return EcoreUtil2.isAssignableFrom(type, input.eClass());
- }
- }));
+ List<EObject> jvmElements = Lists.newArrayList(Iterables.filter(associations.getJvmElements(o),
+ new Predicate<EObject>() {
+ public boolean apply(EObject input) {
+ if (input instanceof JvmConstructor && ((JvmConstructor) input).getParameters().size() == 0)
+ return false;
+ if (type == null)
+ return true;
+ return EcoreUtil2.isAssignableFrom(type, input.eClass());
+ }
+ }));
return jvmElements;
}
-
- protected List<EObject> getFilteredSourceElements(EObject o, final EClass type){
- List<EObject> sourceElements = Lists.newArrayList(Iterables.filter(associations.getSourceElements(o), new Predicate<EObject>() {
- public boolean apply(EObject input) {
- if(type == null)
- return true;
- return EcoreUtil2.isAssignableFrom(type, input.eClass());
- }
- }));
+
+ protected List<EObject> getFilteredSourceElements(EObject o, final EClass type) {
+ List<EObject> sourceElements = Lists.newArrayList(Iterables.filter(associations.getSourceElements(o),
+ new Predicate<EObject>() {
+ public boolean apply(EObject input) {
+ if (type == null)
+ return true;
+ return EcoreUtil2.isAssignableFrom(type, input.eClass());
+ }
+ }));
return sourceElements;
}
-
+
private String computeLinkToElement(EObject jvmElement) {
String imageURL = hoverSignatureProvider.getImageTag(jvmElement);
String signature = hoverSignatureProvider.getDerivedOrSourceSignature(jvmElement);
- return imageURL + createLinkWithLabel(XtextElementLinks.XTEXTDOC_SCHEME, EcoreUtil.getURI(jvmElement), signature);
+ return imageURL
+ + createLinkWithLabel(XtextElementLinks.XTEXTDOC_SCHEME, EcoreUtil.getURI(jvmElement), signature);
}
}
diff --git a/tests/org.eclipse.xtend.ide.tests/src/org/eclipse/xtend/ide/tests/macros/ActiveAnnotationsProcessingInIDETest.xtend b/tests/org.eclipse.xtend.ide.tests/src/org/eclipse/xtend/ide/tests/macros/ActiveAnnotationsProcessingInIDETest.xtend
index 682fbe5..689d3d0 100644
--- a/tests/org.eclipse.xtend.ide.tests/src/org/eclipse/xtend/ide/tests/macros/ActiveAnnotationsProcessingInIDETest.xtend
+++ b/tests/org.eclipse.xtend.ide.tests/src/org/eclipse/xtend/ide/tests/macros/ActiveAnnotationsProcessingInIDETest.xtend
@@ -31,7 +31,6 @@ import org.eclipse.xtext.ui.resource.XtextResourceSetProvider
import org.eclipse.xtext.util.StringInputStream
import org.eclipse.xtext.xbase.lib.Pair
import org.junit.After
-import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@@ -54,7 +53,6 @@ class ActiveAnnotationsProcessingInIDETest extends AbstractReusableActiveAnnotat
}
@Test
- @Ignore
def void testDocumetationProvider() {
assertProcessing(
'annotation/ChangeDoc.xtend' -> '''
diff --git a/tests/org.eclipse.xtend.ide.tests/xtend-gen/org/eclipse/xtend/ide/tests/macros/ActiveAnnotationsProcessingInIDETest.java b/tests/org.eclipse.xtend.ide.tests/xtend-gen/org/eclipse/xtend/ide/tests/macros/ActiveAnnotationsProcessingInIDETest.java
index 3bfcb6d..3d02946 100644
--- a/tests/org.eclipse.xtend.ide.tests/xtend-gen/org/eclipse/xtend/ide/tests/macros/ActiveAnnotationsProcessingInIDETest.java
+++ b/tests/org.eclipse.xtend.ide.tests/xtend-gen/org/eclipse/xtend/ide/tests/macros/ActiveAnnotationsProcessingInIDETest.java
@@ -59,7 +59,6 @@ import org.eclipse.xtext.xbase.lib.Pair;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import org.junit.After;
import org.junit.Assert;
-import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -78,7 +77,6 @@ public class ActiveAnnotationsProcessingInIDETest extends AbstractReusableActive
}
@Test
- @Ignore
public void testDocumetationProvider() {
StringConcatenation _builder = new StringConcatenation();
_builder.append("package annotation");