Merge pull request #521 from Bl3nd/go-to-enhancement
A small update to parsing
This commit is contained in:
commit
edadceba64
|
@ -513,6 +513,7 @@ public class BytecodeViewPanelUpdater implements Runnable
|
||||||
if (token == null)
|
if (token == null)
|
||||||
{
|
{
|
||||||
highlighterEx.clearMarkOccurrencesHighlights();
|
highlighterEx.clearMarkOccurrencesHighlights();
|
||||||
|
errorStripe.refreshMarkers();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,7 @@ public class ClassFileContainer
|
||||||
{
|
{
|
||||||
if (shouldParse())
|
if (shouldParse())
|
||||||
{
|
{
|
||||||
TypeSolver typeSolver = new CombinedTypeSolver(new ReflectionTypeSolver(false), new JarTypeSolver(path));
|
TypeSolver typeSolver = new CombinedTypeSolver(new ReflectionTypeSolver(true), new JarTypeSolver(path));
|
||||||
JavaParser parser = new JavaParser();
|
JavaParser parser = new JavaParser();
|
||||||
parser.getParserConfiguration().setSymbolResolver(new JavaSymbolSolver(typeSolver));
|
parser.getParserConfiguration().setSymbolResolver(new JavaSymbolSolver(typeSolver));
|
||||||
ParseResult<CompilationUnit> parse = parser.parse(this.content);
|
ParseResult<CompilationUnit> parse = parser.parse(this.content);
|
||||||
|
|
|
@ -347,7 +347,7 @@ public class MyVoidVisitor extends VoidVisitorAdapter<Object>
|
||||||
new ClassReferenceLocation(getOwner(classFileContainer),
|
new ClassReferenceLocation(getOwner(classFileContainer),
|
||||||
packagePath, "", "reference", classValue.line, classValue.columnStart, classValue.columnEnd + 1));
|
packagePath, "", "reference", classValue.line, classValue.columnStart, classValue.columnEnd + 1));
|
||||||
}
|
}
|
||||||
catch (ClassCastException | UnsupportedOperationException | IllegalArgumentException e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
printException(n, e);
|
printException(n, e);
|
||||||
}
|
}
|
||||||
|
@ -401,7 +401,7 @@ public class MyVoidVisitor extends VoidVisitorAdapter<Object>
|
||||||
if (node instanceof ObjectCreationExpr)
|
if (node instanceof ObjectCreationExpr)
|
||||||
{
|
{
|
||||||
NodeList<BodyDeclaration<?>> bodyDeclarations =
|
NodeList<BodyDeclaration<?>> bodyDeclarations =
|
||||||
((ObjectCreationExpr) node).getAnonymousClassBody().orElse(null);
|
((ObjectCreationExpr) node).getAnonymousClassBody().orElse(null);
|
||||||
if (bodyDeclarations != null)
|
if (bodyDeclarations != null)
|
||||||
{
|
{
|
||||||
if (Objects.requireNonNull(bodyDeclarations.getFirst().orElse(null)).equals(n))
|
if (Objects.requireNonNull(bodyDeclarations.getFirst().orElse(null)).equals(n))
|
||||||
|
@ -421,10 +421,10 @@ public class MyVoidVisitor extends VoidVisitorAdapter<Object>
|
||||||
|
|
||||||
Value constructor = new Value(n.getName(), range);
|
Value constructor = new Value(n.getName(), range);
|
||||||
this.classFileContainer.putMethod(constructor.name, new ClassMethodLocation(resolve.getClassName(),
|
this.classFileContainer.putMethod(constructor.name, new ClassMethodLocation(resolve.getClassName(),
|
||||||
signature, parameters, "declaration", constructor.line, constructor.columnStart,
|
signature, parameters, "declaration", constructor.line, constructor.columnStart,
|
||||||
constructor.columnEnd + 1));
|
constructor.columnEnd + 1));
|
||||||
}
|
}
|
||||||
catch (RuntimeException e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
printException(n, e);
|
printException(n, e);
|
||||||
}
|
}
|
||||||
|
@ -566,7 +566,7 @@ public class MyVoidVisitor extends VoidVisitorAdapter<Object>
|
||||||
Value field = new Value(variableDeclarator.getName(), range);
|
Value field = new Value(variableDeclarator.getName(), range);
|
||||||
|
|
||||||
this.classFileContainer.putField(field.name, new ClassFieldLocation(getOwner(classFileContainer),
|
this.classFileContainer.putField(field.name, new ClassFieldLocation(getOwner(classFileContainer),
|
||||||
"declaration", field.line, field.columnStart, field.columnEnd + 1));
|
"declaration", field.line, field.columnStart, field.columnEnd + 1));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -828,8 +828,8 @@ public class MyVoidVisitor extends VoidVisitorAdapter<Object>
|
||||||
|
|
||||||
Value methodCall = new Value(n.getName(), methodRange);
|
Value methodCall = new Value(n.getName(), methodRange);
|
||||||
this.classFileContainer.putMethod(methodCall.name,
|
this.classFileContainer.putMethod(methodCall.name,
|
||||||
new ClassMethodLocation(resolve.getClassName(), signature, parameters, "reference", methodCall.line,
|
new ClassMethodLocation(resolve.getClassName(), signature, parameters, "reference", methodCall.line,
|
||||||
methodCall.columnStart, methodCall.columnEnd + 1));
|
methodCall.columnStart, methodCall.columnEnd + 1));
|
||||||
|
|
||||||
if (method != null)
|
if (method != null)
|
||||||
{
|
{
|
||||||
|
@ -875,7 +875,7 @@ public class MyVoidVisitor extends VoidVisitorAdapter<Object>
|
||||||
|
|
||||||
Value method = new Value(n.getName(), methodRange);
|
Value method = new Value(n.getName(), methodRange);
|
||||||
this.classFileContainer.putMethod(method.name, new ClassMethodLocation(resolve.getClassName(), signature,
|
this.classFileContainer.putMethod(method.name, new ClassMethodLocation(resolve.getClassName(), signature,
|
||||||
parameters, "declaration", method.line, method.columnStart, method.columnEnd + 1));
|
parameters, "declaration", method.line, method.columnStart, method.columnEnd + 1));
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user