-
Notifications
You must be signed in to change notification settings - Fork 401
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
Return outline/documentSymbols even for .java files that are not in a Java project #2809
Comments
So a subset of language support that invisible projects provide without the invisible project part. I'm sure it would be possible to create some project type that could handle this. Or if all we care about is document symbols, it's probably easier just to hardcode the logic just for that method. My only worry would be, what happens when users ask for more support (src/out/lib config, jvm config) ? Is there any way to change our virtual/invisible project solution so that it would actually work in Eclipse ? |
Not really, or even not at all ;) I don't advocate for more project type, more invisible stuff. It's only that JDT can provide document symbols (list declared fields) for any Java file without the need for a project, and I would like JDT-LS to be capable of achieving the same.
It's so far the only case that I'm aware where JDT can do something useful without a project. So yes, it can be just the documentSymbol implementation that can be changed to not require a project. |
The makes that the documentSymbols (and probably some other requests) capable of processing files that are not imported in any way in the workspace. It consists of mainly * Adding capability to create an ICompilationUnit for those files * Adding extra-logic to resolve an URI for ICompilationUnit that are not backed by an IFile. Fixes eclipse-jdtls#2809
Actually, I think it would also be possible to provide hover (rendered javadoc for declared elements) without having the project. And if JDT-LS has it (which is most likely doable), then it would be 1 small feature JDT-UI would miss compared to JDT-LS. |
The makes that the documentSymbols (and probably some other requests) capable of processing files that are not imported in any way in the workspace. It consists of mainly * Adding capability to create an ICompilationUnit for those files * Adding extra-logic to resolve an URI for ICompilationUnit that are not backed by an IFile. Fixes #2809
In eclipseide-jdtls, we open .java files which are not in a Java project. We've disabled JDT-LS capability to place .java files in as linked resources in a "virtual" project as it causes confusion with regular usage of the IDE.
Legacy JDT UI is able to provide documentSymbols/quick outline for those files, even without a Java nature nor anything. I supect it can do that only by parsing the file and not trying to resolve anything beyond getting an unbound AST.
Unfortunately JDT-LS doesn't provide that and in case I request quick outline on a "detached" .java file, I get nothing.
It would be convenient if JDT-LS could return the outline symbols for any .java file regardless of its parent project.
The text was updated successfully, but these errors were encountered: