Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only function names without directed segments #5

Open
forgetsuffering opened this issue May 26, 2023 · 4 comments
Open

Only function names without directed segments #5

forgetsuffering opened this issue May 26, 2023 · 4 comments

Comments

@forgetsuffering
Copy link

I have tried this plug-in several times with different java projects, and the generated results are only the functions in the project, and there is no calling relationship between functions, that is, directed line segments.I'm desperate to know what's causing this.
Uploading pic.PNG…

@chanhx
Copy link
Owner

chanhx commented May 26, 2023

What extensions for Java do you have? I have the "Extension Pack for Java" installed in my VS Code, and the calling relationships are shown on the call graph.

Crabviz utilizes the "call hierarchy" capability of LSP server to get the calling relationships, so maybe you should check if "call hierarchy" for Java is supported in your VS Code. Just right click on the name of a Java function, and see if there is a "Show Call Hierarchy" option in the context menu.

@forgetsuffering
Copy link
Author

What extensions for Java do you have? I have the "Extension Pack for Java" installed in my VS Code, and the calling relationships are shown on the call graph.

Crabviz utilizes the "call hierarchy" capability of LSP server to get the calling relationships, so maybe you should check if "call hierarchy" for Java is supported in your VS Code. Just right click on the name of a Java function, and see if there is a "Show Call Hierarchy" option in the context menu.

Ok, thank you. By the way, do I need to compile the project before using this function.

@chanhx
Copy link
Owner

chanhx commented May 26, 2023

do I need to compile the project before using this function.

No, you don't need to compile it.

@chanhx
Copy link
Owner

chanhx commented Jun 3, 2023

I came across this issue recently. It seems to happen when you open a new project, and run Crabviz without any tabs open (the language server has not started). I just rerun the command after waiting a few seconds in that case, and then I got the result as expected. Maybe you can try it again if no edges are shown in the result.

The response of vscode.prepareCallHierarchy is an empty array in the above case, not much info to tell whether the language server is ready or not, so there is no retry logic currently. But I think maybe we can track whether all responses are empty, and retry several times before getting non-empty response. I will try it later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants