Skip to content

Commit

Permalink
Merge pull request #521 from Bl3nd/go-to-enhancement
Browse files Browse the repository at this point in the history
A small update to parsing
  • Loading branch information
Konloch authored Oct 8, 2024
2 parents 3f1fd5a + 9860c9d commit edadceb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ private void markOccurrences(RSyntaxTextArea textArea, ClassFileContainer classF
if (token == null)
{
highlighterEx.clearMarkOccurrencesHighlights();
errorStripe.refreshMarkers();
return;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public boolean parse()
{
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();
parser.getParserConfiguration().setSymbolResolver(new JavaSymbolSolver(typeSolver));
ParseResult<CompilationUnit> parse = parser.parse(this.content);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ public void visit(ClassOrInterfaceType n, Object arg)
new ClassReferenceLocation(getOwner(classFileContainer),
packagePath, "", "reference", classValue.line, classValue.columnStart, classValue.columnEnd + 1));
}
catch (ClassCastException | UnsupportedOperationException | IllegalArgumentException e)
catch (Exception e)
{
printException(n, e);
}
Expand Down Expand Up @@ -401,7 +401,7 @@ public void visit(ConstructorDeclaration n, Object arg)
if (node instanceof ObjectCreationExpr)
{
NodeList<BodyDeclaration<?>> bodyDeclarations =
((ObjectCreationExpr) node).getAnonymousClassBody().orElse(null);
((ObjectCreationExpr) node).getAnonymousClassBody().orElse(null);
if (bodyDeclarations != null)
{
if (Objects.requireNonNull(bodyDeclarations.getFirst().orElse(null)).equals(n))
Expand All @@ -421,10 +421,10 @@ public void visit(ConstructorDeclaration n, Object arg)

Value constructor = new Value(n.getName(), range);
this.classFileContainer.putMethod(constructor.name, new ClassMethodLocation(resolve.getClassName(),
signature, parameters, "declaration", constructor.line, constructor.columnStart,
constructor.columnEnd + 1));
signature, parameters, "declaration", constructor.line, constructor.columnStart,
constructor.columnEnd + 1));
}
catch (RuntimeException e)
catch (Exception e)
{
printException(n, e);
}
Expand Down Expand Up @@ -566,7 +566,7 @@ public void visit(FieldDeclaration n, Object arg)
Value field = new Value(variableDeclarator.getName(), range);

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));
});
}

Expand Down Expand Up @@ -828,8 +828,8 @@ public void visit(MethodCallExpr n, Object arg)

Value methodCall = new Value(n.getName(), methodRange);
this.classFileContainer.putMethod(methodCall.name,
new ClassMethodLocation(resolve.getClassName(), signature, parameters, "reference", methodCall.line,
methodCall.columnStart, methodCall.columnEnd + 1));
new ClassMethodLocation(resolve.getClassName(), signature, parameters, "reference", methodCall.line,
methodCall.columnStart, methodCall.columnEnd + 1));

if (method != null)
{
Expand Down Expand Up @@ -875,7 +875,7 @@ public void visit(MethodDeclaration n, Object arg)

Value method = new Value(n.getName(), methodRange);
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)
{
Expand Down

0 comments on commit edadceb

Please sign in to comment.