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

feat: graceful parsing of load statements #83

Closed
wants to merge 1 commit into from

Conversation

MaartenStaa
Copy link
Contributor

@MaartenStaa MaartenStaa commented Aug 29, 2023

Don't produce a parse error on load statements with only one argument, issue an error to the parser state instead. This allow the LSP to correctly detect when the cursor is inside the first argument to a load statement, and offer autocomplete options accordingly (see also #82).

Don't produce a parse error on `load` statements with only one argument,
issue an error to the parser state instead. This allow the LSP to correctly
detect when the cursor is inside the first argument to a `load` statement,
and offer autocomplete options accordingly.
@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 Aug 29, 2023
@ndmitchell
Copy link
Contributor

Thanks for the diff. Looks good to me, but I'll let @stepancheg review here too, then we can import/merge it.

@stepancheg
Copy link
Contributor

Looks good.

@facebook-github-bot
Copy link
Contributor

@stepancheg has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@stepancheg merged this pull request in 0e5192f.

facebook-github-bot pushed a commit to facebook/buck2 that referenced this pull request Aug 29, 2023
Summary:
Don't produce a parse error on `load` statements with only one argument, issue an error to the parser state instead. This allow the LSP to correctly detect when the cursor is inside the first argument to a `load` statement, and offer autocomplete options accordingly (see also facebook/starlark-rust#82).

X-link: facebook/starlark-rust#83

Reviewed By: ndmitchell

Differential Revision: D48797898

Pulled By: stepancheg

fbshipit-source-id: de47f8d27b3eeca20231b460a141cb08c684079a
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. Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants