Replies: 2 comments
-
Can't your LS just set a more detailed name and/or set the |
Beta Was this translation helpful? Give feedback.
-
Hi @mickaelistria, CDT LSP uses the clangd project and it seems, populating the details field with a file name, a containing class name, or method signature has already been discussed for clangd (see clangd/clangd#1940 and clangd/clangd#1185). Unfortunately, it seems to be unlikely for these changes in clangd to be implemented any time soon. I hoped for a more generic solution, but that would probably involve modifying the LSP standard. I hoped that I could adapt the call hierarchy view for CDT LSP based on already available features (or after minimal changes in LSP4E), but that seems a bit complicated and probably unnecessarily inefficient in terms of runtime. |
Beta Was this translation helpful? Give feedback.
-
When viewing a call hierarchy In JDT and CDT, we're used to see the called methods, but also their parent classes. That's something we're missing in CDT LSP. It seems that's a feature that could be implemented in LSP4E. But I'm not sure how.
For comparison:
CDT's call hierarchy example:
![image](https://private-user-images.githubusercontent.com/10887297/326013848-3d021332-1848-4148-a0f7-974ee9d633e3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNTE2NTcsIm5iZiI6MTczOTE1MTM1NywicGF0aCI6Ii8xMDg4NzI5Ny8zMjYwMTM4NDgtM2QwMjEzMzItMTg0OC00MTQ4LWEwZjctOTc0ZWU5ZDYzM2UzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDAxMzU1N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNkMTFhMGQzNmJiNTk1YmEwMWEzYWZmOWRiMjdkOWFmNzQ0ZmEzZGQ5M2I4YjY1OTJmZGI2NDJmNTk2ZTVhNTkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.WRBsBCM6TLP3fFSF8_W58Ht2EtDeLLs_Si1gprDgY9s)
CDT LSP's call hierarchy example:
![image](https://private-user-images.githubusercontent.com/10887297/326014621-dbfe9b02-f589-481c-88d3-66915b6b1b7d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNTE2NTcsIm5iZiI6MTczOTE1MTM1NywicGF0aCI6Ii8xMDg4NzI5Ny8zMjYwMTQ2MjEtZGJmZTliMDItZjU4OS00ODFjLTg4ZDMtNjY5MTViNmIxYjdkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDAxMzU1N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTk2OTYyNmQwYmI1ZjhhMDAwNTNlNzU0MTE0MjBmYjU5ZDIzNjIxMGYwZjdjOGRlZjcxNmEyMDlhZjZhNWZmMjMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.PnIZKLeMcI9gdF8tHqu41gex1UnvqEZsxiaKqs4kbPk)
The call hierarchy feature is implemented in LSP4E. When debugging
org.eclipse.lsp4e.callhierarchy.CallHierarchyContentProvider#updateCallers(CallHierarchyViewTreeNode)
I didn't see any details about the calling method's parent / container in the language server response. It seems, theCallHierarchyItem
does not provide any information on that, just the calling method's code range.Is there a simpler way of retrieving the calling method's parent class than asking the language server for the method's declaration and then requesting the document symbols for a certain range of code?
Beta Was this translation helpful? Give feedback.
All reactions