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 accidental double pipe in exhaustive switch statements #805

Merged
merged 2 commits into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

- Fix invalid range for `definition`. https://github.com/rescript-lang/rescript-vscode/pull/781
- Don't emit object keys in uppercase as namespace. https://github.com/rescript-lang/rescript-vscode/pull/798
- Fix accidental output of extra `|` when producing exhaustive switch code for polyvariants. https://github.com/rescript-lang/rescript-vscode/pull/805

## 1.18.0

Expand Down
2 changes: 1 addition & 1 deletion analysis/src/CompletionBackEnd.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1672,7 +1672,7 @@ let rec processCompletable ~debug ~full ~scope ~env ~pos ~forHover completable =
~cases:
(v.constructors
|> List.map (fun (constructor : polyVariantConstructor) ->
"| #" ^ constructor.name
"#" ^ constructor.name
^
match constructor.args with
| [] -> ""
Expand Down
2 changes: 1 addition & 1 deletion analysis/tests/src/expected/ExhaustiveSwitch.res.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Path withSomePol
"detail": "insert exhaustive switch for value",
"documentation": null,
"filterText": "withSomePoly",
"insertText": "withSomePoly {\n | | #one => ${1:failwith(\"todo\")}\n | | #three(_) => ${2:failwith(\"todo\")}\n | | #two => ${3:failwith(\"todo\")}\n }",
"insertText": "withSomePoly {\n | #one => ${1:failwith(\"todo\")}\n | #three(_) => ${2:failwith(\"todo\")}\n | #two => ${3:failwith(\"todo\")}\n }",
"insertTextFormat": 2
}]

Expand Down