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
Adding symbol provider to obtain symbols for GoTo Symbol in workspace #4302
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.
Unfortunately, the current design of SymbolProvider
that returns a list of StructureElements
IMHO does not fit to the lazy source file loading mechanism currently implemented in Java symbol extraction.
…out changes in the api.
I changed the implementation. Now the implementation does not require any API change. On the other hand, LSP Server depends on CSL API and CSL Types. |
IMHO dependency on CSL is not harmful, as CSL provides common infra for many languages (groovy included, 😉). |
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.
Good as a temporary solution. Later we should create an API to unify the Java and CSL parts.
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 reuse of CSL, thanks.
case KEYWORD: return SymbolKind.Key; | ||
case OTHER: return SymbolKind.Object; | ||
case PACKAGE: return SymbolKind.Package; | ||
case PARAMETER: return SymbolKind.TypeParameter; |
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.
Maybe SymbolKind.Variable
could be better ?
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.
Yes, it can be better. I will change it.
Adds a Go To Symbol functionality for Groovy source files in VSCode. Symbols are obtained from IndexSearcher (part of the CSL API). This implementation should only be temporary and should be replaced by a suitable API for retrieving symbols with lazy location, which may not return immediately, but only when the symbol is selected.