You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I have noticed that since the last version of the extension (v 1.12), finding the references of a symbol now includes the declaration of the symbol. This new feature was asked in this issue and was resolved by managing the includeDeclaration provided in the context of the textDocument/references request.
I have tested this new feature and I found some strange results in my opinion. This happens when using anonymous class.
First case with anonymous classes
In the first screenshot I'm sending, I instantiate multiple anonymous classes form the interface ActionListener. And if I ask for the references on a specific actionPerformed method, the language servers returns all the declarations of this method, even if they are from different anonymous classes.
Second classes with named classes
Now in the second screenshot, instead of using anonymous classes, I define multiple classes that implement the ActionListener interface. Now, if I ask for the references on a specific actionPerformed method, this time i will only get the declaration of the given symbol, not the declarations of this method done by the other classes.
Discussion
I'm not really sure, but i do think that the results from the second case (with the named classes) is more "correct". In this case, I do get only the references on the symbol i asked. While in the first case (with the anonymous classes), I also get the declarations done by other anonymous classes that are not related to the specific symbol I ask.
Disable the includeDeclaration ?
And one more question, is it possible to set the includeDeclaration flag to false while using your extension?
Thank's in advance for your returns ;)
The text was updated successfully, but these errors were encountered:
Environment
Description
Hello, I have noticed that since the last version of the extension (v 1.12), finding the references of a symbol now includes the declaration of the symbol. This new feature was asked in this issue and was resolved by managing the
includeDeclaration
provided in the context of thetextDocument/references
request.I have tested this new feature and I found some strange results in my opinion. This happens when using anonymous class.
First case with anonymous classes
In the first screenshot I'm sending, I instantiate multiple anonymous classes form the interface ActionListener. And if I ask for the references on a specific
actionPerformed
method, the language servers returns all the declarations of this method, even if they are from different anonymous classes.Second classes with named classes
Now in the second screenshot, instead of using anonymous classes, I define multiple classes that implement the ActionListener interface. Now, if I ask for the references on a specific
![just-one-declaration](https://user-images.githubusercontent.com/18572297/200037622-c6ed27c9-f459-466f-877a-084ed4d7b1b9.png)
actionPerformed
method, this time i will only get the declaration of the given symbol, not the declarations of this method done by the other classes.Discussion
I'm not really sure, but i do think that the results from the second case (with the named classes) is more "correct". In this case, I do get only the references on the symbol i asked. While in the first case (with the anonymous classes), I also get the declarations done by other anonymous classes that are not related to the specific symbol I ask.
Disable the
includeDeclaration
?And one more question, is it possible to set the
includeDeclaration
flag tofalse
while using your extension?Thank's in advance for your returns ;)
The text was updated successfully, but these errors were encountered: