-
Notifications
You must be signed in to change notification settings - Fork 408
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
Renaming or creating a java file requires restart #486
Conversation
private ICompilationUnit createCompilationUnit(ICompilationUnit unit) { | ||
try { | ||
unit.getResource().refreshLocal(IResource.DEPTH_ONE, new NullProgressMonitor()); | ||
if (unit.getResource().exists()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't we check the resource exists BEFORE refreshing it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this method is largely similar to the block you modified in DocumentLifeCycleHandler.handleOpen, yet the conditions are different. Here the resource needs to exists, in handleOpen, it must not be accessible (doesn't exist). Seems dubious. Both places should probably be refactored to call the same logic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The resource must exist after refreshing.
@snjeza can we have some integration tests here or is it too complex? |
@fbricon I will try to create a test. |
Signed-off-by: Snjezana Peco <[email protected]>
@fbricon I have updated the PR. |
Fixes redhat-developer/vscode-java#380
Signed-off-by: Snjezana Peco [email protected]