redhat-developer / redhat-developer/vscode-java
Imports are not included in the document symbols returned from "getDocumentSymbols" API
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 546
- Avg merge
- 20h 1m
- Merged PRs (30d)
- 11
Description
Hi
I am writing a vscode extension and I want to get the symbols of a JAVA file.
Environment
Operating System: windows 10
Visual Studio Code version: 1.50.0
Steps To Reproduce
If I run this sample code :
`const vscodeCDSExtension = extensions.getExtension("redhat.java");
const javaDocParams : DocumentSymbolParams = {
textDocument: {
uri: Uri.file(filePath).toString()
}
};
if (vscodeCDSExtension && vscodeCDSExtension.isActive) {
const symbols = await vscodeCDSExtension.exports.getDocumentSymbols(javaDocParams);
console.log(symbols.length);
}`
Current Result
The "imports" of the file are not included in the returned symbols (only "package", classes and methods are returned)
Expected Result
The "imports" also should be included in the result
The JAVA file is attached
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the getDocumentSymbols API call from the issue with the attached CatalogServiceHandler.zip Java file. Trace how package, classes, and methods are returned, then verify that import declarations are included in the symbols result and add or update coverage if the repository provides a matching test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, typescript, vscode
- Domain
- api, developer-experience, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100