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(parser): mixed side effects of different choices in parse_oneof #14912

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

Conversation

blindFS
Copy link
Contributor

@blindFS blindFS commented Jan 25, 2025

Description

This PR fixes #14784.

image

Also fixes the related behavior of lsp:

completion won't work in match/else blocks, because:

  1. truncation in completion causes unmatched {, thus a parse error.
  2. the parse error further leads to a state where the whole block expression marked as garbage
image

Related PR: #14856, @tmillr

I don't have any background knowledge of those propagate_error, @sgvictorino you may want to review this.

User-Facing Changes

Tests + Formatting

After Submitting

@blindFS
Copy link
Contributor Author

blindFS commented Jan 25, 2025

Also one of the many causes of #14697

Although not manifested yet, there are still potential mixed side effects in the mutable working_set.

@blindFS blindFS marked this pull request as ready for review January 25, 2025 03:02
@fdncred fdncred added parser Issues related to parsing pr:bugfix This PR fixes some bug LSP Language Server Protocol (nu-lsp) completions Issues related to tab completion labels Jan 25, 2025
@tmillr
Copy link

tmillr commented Jan 26, 2025

This doesn't fix the completion issue described in #11084. For that you need to use a command which has/accepts unique flags in order to test it (e.g. do open - and then see if --raw appears in the list or not). echo won't work because it doesn't take any flags.

@blindFS
Copy link
Contributor Author

blindFS commented Jan 26, 2025

This doesn't fix the completion issue described in #11084. For that you need to use a command which has/accepts unique flags in order to test it (e.g. do open - and then see if --raw appears in the list or not). echo won't work because it doesn't take any flags.

Oh, you're right. This PR fixes completions in blocks of else/match, but #11084 is another story.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completions Issues related to tab completion LSP Language Server Protocol (nu-lsp) parser Issues related to parsing pr:bugfix This PR fixes some bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect highlighting of parse errors in else body
3 participants