feat: support document symbols requests in lsp#115
Open
MaartenStaa wants to merge 2 commits intofacebook:mainfrom
Open
feat: support document symbols requests in lsp#115MaartenStaa wants to merge 2 commits intofacebook:mainfrom
MaartenStaa wants to merge 2 commits intofacebook:mainfrom
Conversation
28bbf76 to
c05fce3
Compare
This allows requesting a list/tree of symbols in the current document.
The following items are currently exposed:
- `load` statements:
- The module path
- The loaded symbol names
- `def` statements:
- The function node
- Argument names
- Closures, when assigned to a named variable
- Structs (calls to `struct`), when assigned to a named variable
- Build system targets (function calls containing a `name` argument)
c05fce3 to
0978484
Compare
stepancheg
suggested changes
Mar 15, 2024
starlark_lsp/src/symbols.rs
Outdated
| vec![ | ||
| #[allow(deprecated)] | ||
| DocumentSymbol { | ||
| name: "foo.star".to_owned(), |
Contributor
There was a problem hiding this comment.
This is not very good test: it is not readable, and modifying this test would be very hard.
Contributor
Author
There was a problem hiding this comment.
You're right, just pushed a commit to make the test much more readable and maintainable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This allows requesting a list/tree of symbols in the current document. The following items are currently exposed:
loadstatements:defstatements:struct), when assigned to a named variablenameargument)Example from
starlark_syntax/testcases/parse/android_sdk_repository_template.star: