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

Fix hover info & go to definition for named parameters #118

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

MaartenStaa
Copy link
Contributor

Builds on top of #117

Previously, hovering over or triggering "go to definition" for named parameters in function calls did nothing. This PR makes sure the required information is exposed, so both of these work as expected.

Example from starlark_syntax/testcases/parse/aspect.star (after adding function documentation—otherwise only go to definition does anything):
Screenshot 2024-03-15 at 14 42 03

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)
Allow passing in an `--eager` flag to the LSP to make it eagerly load
all relevant files in the workspace. When this flag is provided, files
are not removed from the `last_valid_parse` cache when they are closed.

In addition, this flag enables the LSP to provide workspace symbol
information.
…}` and `starlark_lsp::symbol::{Symbol, SymbolKind}`
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants