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

Wrong URI set for diagnostics of standalone java files #268

Closed
fbricon opened this issue Jun 21, 2017 · 0 comments
Closed

Wrong URI set for diagnostics of standalone java files #268

fbricon opened this issue Jun 21, 2017 · 0 comments

Comments

@fbricon
Copy link
Contributor

fbricon commented Jun 21, 2017

When opening a standalone java file, we 1st link it to the default Java project in JDTUtils.getFakeCompilationUnit. The link is performed in a workspace job, but JDTUtils.getFakeCompilationUnit is already called within a IWorkspaceRunnable, in DocumentLifeCycleHandler.didOpen.
So by the time JDTUtils.getFakeCompilationUnit returns, the resource has not been actually linked yet, because the linking job hasn't run, which causes diagnostics to return the uri of the linked resource, not the one from the actual file

@fbricon fbricon added the bug label Jun 21, 2017
fbricon added a commit to fbricon/eclipse.jdt.ls that referenced this issue Jun 21, 2017
Fixes eclipse-jdtls#268

Signed-off-by: Fred Bricon <fbricon@gmail.com>
@fbricon fbricon self-assigned this Jun 21, 2017
fbricon added a commit that referenced this issue Jun 21, 2017
Fixes #268

Signed-off-by: Fred Bricon <fbricon@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant