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

LSP: Fixed problem with workspace/symbols called before first JavacCompiler created. #6419

Merged
merged 1 commit into from
Sep 8, 2023

Conversation

dbalek
Copy link
Contributor

@dbalek dbalek commented Sep 7, 2023

The problem was with ParserManager.parseWhenScanFinished("text/x-java", new UserTask() {... called before the first JavacParser was created by java.source infrastructure. Since JavacParser cannot be created without supplying a ClasspathInfo, exception was thrown and the given UserTask was not executed. Fixed by supplying the ClasspathInfo based on the opened projects.

@dbalek dbalek added LSP [ci] enable Language Server Protocol tests VSCode Extension [ci] enable VSCode Extension tests labels Sep 7, 2023
@dbalek dbalek added this to the NB20 milestone Sep 7, 2023
@dbalek dbalek self-assigned this Sep 7, 2023
@lahodaj
Copy link
Contributor

lahodaj commented Sep 7, 2023

I don't mind this patch, but I wonder if there would be opportunity to solve this in the infrastructure, e.g. by synthesizing some ClasspathInfo when none is provided for this task?

@dbalek
Copy link
Contributor Author

dbalek commented Sep 7, 2023

I don't mind this patch, but I wonder if there would be opportunity to solve this in the infrastructure, e.g. by synthesizing some ClasspathInfo when none is provided for this task?

It is hard to create any ClasspathInfo without a FileObject (before any project or file gets opened)

@dbalek dbalek force-pushed the dbalek/lsp-workspace-symbols-fix branch from 7379482 to 2f66050 Compare September 8, 2023 06:27
@dbalek dbalek merged commit 9dfdf28 into apache:master Sep 8, 2023
34 checks passed
@dbalek dbalek deleted the dbalek/lsp-workspace-symbols-fix branch September 8, 2023 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LSP [ci] enable Language Server Protocol tests VSCode Extension [ci] enable VSCode Extension tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants