[Repo Assist] feat: add code fix for wildcard _ -> in pattern match for FS0043#1472
Merged
Krzysztof-Cieslak merged 2 commits intomainfrom Feb 26, 2026
Conversation
Rebased changes from PR #1157 by @jkone27 onto current main. Adds a code fix that suggests replacing the invalid infix operator '|->' with the correct wildcard pattern '| _ ->' in a match expression when the F# compiler diagnostic FS0043 is raised. Closes #1157 Co-authored-by: jkone27 <10419217+jkone27@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
11 tasks
github-actions bot
added a commit
that referenced
this pull request
Feb 26, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This is an automated PR from Repo Assist, created on behalf of @Krzysztof-Cieslak's request to rebase PR #1157.
Summary
This PR rebases the changes from #1157 by @jkone27 onto current
main. It adds a code fix that suggests replacing the invalid|->operator with the correct wildcard pattern| _ ->in a match expression when the F# compiler diagnostic FS0043 is raised.Related issue: dotnet/fsharp#15748
Changes
src/FsAutoComplete/CodeFixes/AddMissingWildcardOperator.fs— new code fix implementationsrc/FsAutoComplete/CodeFixes/AddMissingWildcardOperator.fsi— signature filesrc/FsAutoComplete/LspServers/AdaptiveServerState.fs— register the new code fixtest/FsAutoComplete.Tests.Lsp/CodeFixTests/AddMissingWildcardOperatorTests.fs— test for the code fixtest/FsAutoComplete.Tests.Lsp/CodeFixTests/Tests.fs— register test moduleRebase notes
The following adaptations were made when rebasing onto current
main:FsAutoComplete.Lsp.fswas removed from the codebase — that change was droppedAdaptiveFSharpLspServer.fstoAdaptiveServerState.fsftestCaseAsync→testCaseAsync(focused test markers cause CI failures)lineStr→_lineStr(F# compiler error FS1182)Test Status
✅ Build succeeded (
dotnet build src/FsAutoComplete/FsAutoComplete.fsproj)✅ Code formatted with
dotnet fantomasCloses #1157