Skip to content
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

Merged
merged 4 commits into from Jul 12, 2022

Conversation

ppisl
Copy link
Member

@ppisl ppisl commented Jun 30, 2022

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.

@ppisl ppisl requested review from dbalek and sdedic June 30, 2022 14:18
Copy link
Contributor

@dbalek dbalek left a 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.

@ppisl
Copy link
Member Author

ppisl commented Jul 11, 2022

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.

@sdedic
Copy link
Member

sdedic commented Jul 11, 2022

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, 😉).

Copy link
Contributor

@dbalek dbalek left a 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.

Copy link
Member

@sdedic sdedic left a 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;
Copy link
Member

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 ?

Copy link
Member Author

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.

@ppisl ppisl merged commit 028c7a2 into apache:master Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants