aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzzhongwei2013-03-11 01:53:50 (EDT)
committerzzhongwei2013-03-11 01:53:50 (EDT)
commit03baf78f10747f1a7fda6bf59a997420c5e5f9da (patch)
treec34bae152d801175ba9c0263309fd5e14cb6d4b7
parent7ec21f8bd2990b7e0639ac3ae7dfcb0c6200d7fa (diff)
downloadorg.eclipse.pdt-03baf78f10747f1a7fda6bf59a997420c5e5f9da.zip
org.eclipse.pdt-03baf78f10747f1a7fda6bf59a997420c5e5f9da.tar.gz
org.eclipse.pdt-03baf78f10747f1a7fda6bf59a997420c5e5f9da.tar.bz2
396654: Content Assist in PHPdoc for inline @link does not work when
linked to property https://bugs.eclipse.org/bugs/show_bug.cgi?id=396654
-rw-r--r--plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/documentation/PHPDocumentationContentAccess.java21
-rw-r--r--plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/documentation/PHPElementLinks.java13
2 files changed, 25 insertions, 9 deletions
diff --git a/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/documentation/PHPDocumentationContentAccess.java b/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/documentation/PHPDocumentationContentAccess.java
index ed0c7c6..4d57484 100644
--- a/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/documentation/PHPDocumentationContentAccess.java
+++ b/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/documentation/PHPDocumentationContentAccess.java
@@ -923,14 +923,25 @@ public class PHPDocumentationContentAccess {
description = url;
}
String link = "<a href=\"" + url + "\">" + description + "</a>";
- m.appendReplacement(sb, link);
+ // m.appendReplacement(sb, link);
+ sb.append(fBuf.toString().replace(m.group(), link));
} else {
- m.appendReplacement(sb,
- handleLink(Arrays.asList(new TypeReference(0, 0, url)))
- .toString());
+ sb.append(fBuf.toString()
+ .replace(
+ m.group(),
+ handleLink(Arrays.asList(new TypeReference(0,
+ 0, url)))));
+ // try {
+ // m.appendReplacement(
+ // sb,
+ // handleLink(
+ // Arrays.asList(new TypeReference(0, 0, url)))
+ // .toString());
+ // } catch (Exception e) {
+ // }
}
}
- m.appendTail(sb);
+ // m.appendTail(sb);
fBuf = sb;
sb = null;
}
diff --git a/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/documentation/PHPElementLinks.java b/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/documentation/PHPElementLinks.java
index afe6a9e..7f1ff45 100644
--- a/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/documentation/PHPElementLinks.java
+++ b/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/documentation/PHPElementLinks.java
@@ -189,10 +189,12 @@ public class PHPElementLinks {
IType[] types = null;
try {
-
- int offset = member.getSourceRange() != null ? member.getSourceRange().getOffset() : 0;
+
+ int offset = member.getSourceRange() != null ? member
+ .getSourceRange().getOffset() : 0;
types = PHPModelUtils.getTypes(refTypeName,
- member.getSourceModule(), offset, new NullProgressMonitor());
+ member.getSourceModule(), offset,
+ new NullProgressMonitor());
} catch (ModelException e) {
PHPUiPlugin.log(e);
}
@@ -202,9 +204,12 @@ public class PHPElementLinks {
if (segments.length > 3) {
String refMemberName = segments[3];
IMethod method = type.getMethod(refMemberName);
- if (method != null) {
+ if (method != null && method.exists()) {
return method;
} else {
+ // if (refMemberName.startsWith("$")) {
+ // refMemberName = refMemberName.substring(0);
+ // }
return type.getField(refMemberName);
}
}