Allowing refactorings for java files not part of any project.#8442
Allowing refactorings for java files not part of any project.#8442mbien merged 1 commit intoapache:masterfrom
Conversation
|
In principle this seems a good idea. I would still like to see the reversal of dependency as discussed with @lahodaj in #7776 (comment) though. That might impact how this is implemented. |
lahodaj
left a comment
There was a problem hiding this comment.
I am not completely sure SourceLauncher.isSourceLauncherFile does the correct thing anymore (after the many changes in MultiSourceRootProvider), but this change is in a reasonable direction.
Regarding direction of dependencies, this file already uses calls the isSourceLauncher method, only a few lines above the new use, so it seems OK to add a new call, and possibly revise the two calls together.
|
this is probably fine but we have to refactor more often. Those methods were deprecated even though they aren't public API (could have been replaced right away).
|
Issue
Consider a java file not part of any project . Code Refactorings are not available currently as the file is marked as not refactorable by the
isRefactorablemethod when it checks for the condition ofisOnSourceClasspath. The methodisOnSourceClasspathmarks the file as not refactorable as the file is not part of any project.Fix Done
If a file is not found to be part of any project then using the
SourceLauncher.isSourceLauncherFilefunction we can check if it is a single source file similar to what is already being done in theisFileInOpenProjectmethod .