-
Notifications
You must be signed in to change notification settings - Fork 26
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
Replaced the usage of deprecated method DumbService.runReadActionInSmartMode(Computable) #1207
base: main
Are you sure you want to change the base?
Conversation
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.
I've noticed that all the changes in this PR are to classes in the lsp4mp4ij package. These classes have been copied from Intellij Quarkus. We should check whether Red Hat has addressed these issues with using deprecated methods in their current code and consider contributing a PR if they have not. We periodically update LSP4MP4IJ from IntelliJ Quarkus. It is best from a maintenance perspective to be as close to the Red Hat version as possible as there is risk each time we update that we lose changes that have only been locally made in Liberty Tools for IntelliJ.
Sure @mrglavas. Let me have a look on the same |
@mrglavas The deprecated method Intellij Quarkus didn't replaced the deprecated references from LTI introduced Could you please let me know whether we need to raise a PR on Also can we raise a seperate PR in LTI to handle deprecation in |
@dessina-devasia I do think it would be a good idea to raise a PR against IntelliJ Quarkus for all of these changes. |
sure @mrglavas |
@@ -97,7 +95,10 @@ public ProjectLabelInfoEntry getProjectLabelInfo(MicroProfileJavaProjectLabelsPa | |||
if (module == null) { | |||
return ProjectLabelInfoEntry.EMPTY_PROJECT_INFO; | |||
} | |||
return DumbService.getInstance(module.getProject()).runReadActionInSmartMode(() -> getProjectLabelInfo(module, params.getTypes(), utils)); | |||
Project project = module.getProject(); |
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.
Since this code should be executed with LSP4IJ in an NonBlocking ReadAction, I wonder if we should not wrap this code with a new NonBlocking ReadAction and just return
return getProjectLabelInfo(module, params.getTypes(), utils)
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.
@angelozerr Thank you. Its addressed
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.
Have you checked that it is working?
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.
@angelozerr Yes. It is working fine as expected. As you said, getProjectLabelInfo() is already executed in a NonBlocking ReadAction. Let me create similar PR in IntelliJ Quarkus as suggested by @mrglavas
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.
Nice! Thanks for your PR
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.
@angelozerr I've created a related issue #1420 and corresponding PR in IntelliJ Quarkus. Please have a look. Thank you.
…ady executed in a NonBlocking ReadAction
@mrglavas As discussed I've created a related issue #1420 and its PR in IntelliJ Quarkus. Please have a look. |
…eady executed in a NonBlocking ReadAction.
…dy executed in a NonBlocking ReadAction.
@dessina-devasia With the green builds I'm going to approve this one, but please keep in synch with the PR you opened in IntelliJ Quarkus if there are any further changes required. Also, can you update the description of this PR to describe the current changes? You don't seem to be using |
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.
Looks good. Thanks for following-up and opening the PR for IntelliJ Quarkus.
Thank you @mrglavas |
Fixes #1176
The deprecated method
DumbService.runReadActionInSmartMode(Computable)
has been removed.Its replacement,
ReadAction.nonBlocking(...).inSmartMode(project).executeSynchronously()
, is not explicitly required here because the methodsProjectLabelManager.getProjectLabelInfo()
,PropertiesManager.findPropertyLocation()
, andDiagnosticsHandler.collectDiagnostics()
are already executed within a NonBlocking ReadAction.