Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

import org.eclipse.jdt.core.IClassFile;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IField;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.ITypeRoot;
import org.eclipse.jdt.core.compiler.IProblem;
import org.eclipse.jdt.core.dom.AST;
import org.eclipse.jdt.core.dom.ASTParser;
Expand All @@ -32,15 +32,21 @@ public List<SymbolInformation> get(SearchMatch match) {
// For Method Calls we will need to do the local variable trick
try {
MethodReferenceMatch m = (MethodReferenceMatch) match;
IMethod e = (IMethod) m.getElement();
IJavaElement e = (IJavaElement) m.getElement();
SymbolInformation symbol = new SymbolInformation();
Location location = getLocation((IJavaElement) match.getElement(), match);
symbol.setName(e.getElementName());
symbol.setKind(convertSymbolKind(e));
symbol.setContainerName(e.getParent().getElementName());
symbol.setLocation(location);
if (this.query.contains(".")) {
ICompilationUnit unit = e.getCompilationUnit();
ICompilationUnit unit = null;
if (m.getElement() instanceof IMethod) {
unit = ((IMethod) m.getElement()).getCompilationUnit();
} else if (m.getElement() instanceof IField) {
unit = ((IField) m.getElement()).getCompilationUnit();
}

if (unit == null) {
IClassFile cls = (IClassFile) ((IJavaElement) e).getAncestor(IJavaElement.CLASS_FILE);
if (cls != null) {
Expand Down
Loading