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

Add workspace symbols & --eager flag #116

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

Conversation

MaartenStaa
Copy link
Contributor

Builds on top of #115

Allows passing in the flag --eager, which eagerly loads all relevant documents in the workspace and parses them ahead of time. When this flag is passes, the LSP offers the capability for workspace symbols. This also ensures exported symbols from other files are always available as autocomplete options, rather than having to explicitly open the exporting file first.

Example from this repository:
Screenshot 2024-03-15 at 14 33 51

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.
@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