11
11
import org .eclipse .core .runtime .CoreException ;
12
12
import org .eclipse .core .runtime .NullProgressMonitor ;
13
13
import org .eclipse .jdt .core .dom .MethodDeclaration ;
14
+ import org .eclipse .jdt .core .dom .MethodInvocation ;
15
+ import org .eclipse .jdt .core .dom .SimpleType ;
16
+ import org .eclipse .jdt .core .dom .SingleVariableDeclaration ;
14
17
import org .eclipse .jdt .core .dom .TypeDeclaration ;
18
+ import org .eclipse .jdt .core .dom .VariableDeclarationFragment ;
15
19
import org .eclipse .jdt .ls .core .internal .JDTUtils ;
16
20
import org .eclipse .lsp4j .Location ;
17
21
import org .eclipse .lsp4j .Position ;
@@ -32,10 +36,37 @@ public class ReferencesVisitor extends ProtocolVisitor {
32
36
public ReferencesVisitor () {
33
37
}
34
38
39
+ @ Override
40
+ public boolean visit (SimpleType type ) {
41
+ emitReferences (type .getStartPosition (), type .getLength ());
42
+ return super .visit (type );
43
+ }
44
+
45
+ @ Override
46
+ public boolean visit (SingleVariableDeclaration node ) {
47
+ emitReferences (node .getName ().getStartPosition (), node .getName ().getLength ());
48
+ return super .visit (node );
49
+ }
50
+
51
+ @ Override
52
+ public boolean visit (VariableDeclarationFragment node ) {
53
+ emitReferences (node .getName ().getStartPosition (), node .getName ().getLength ());
54
+ return super .visit (node );
55
+ }
56
+
57
+ @ Override
58
+ public boolean visit (MethodInvocation node ) {
59
+ emitReferences (node .getName ().getStartPosition (), node .getName ().getLength ());
60
+ if (node .getExpression () != null ) {
61
+ emitReferences (node .getExpression ().getStartPosition (), node .getExpression ().getLength ());
62
+ }
63
+ return super .visit (node );
64
+ }
65
+
35
66
@ Override
36
67
public boolean visit (MethodDeclaration node ) {
37
68
emitReferences (node .getName ().getStartPosition (), node .getName ().getLength ());
38
- return false ;
69
+ return super . visit ( node ) ;
39
70
}
40
71
41
72
@ Override
0 commit comments