[Repo Assist] test: add regression tests for false positive code fix scenarios (issues #1259, #1362)#1523
Draft
github-actions[bot] wants to merge 2 commits intomainfrom
Conversation
…ier when variable shadows property (issue #1259) This test verifies that FSAC/FCS does not incorrectly emit the 'This qualifier is redundant' diagnostic when a local variable shadows a member property with the same name. In the failing scenario, a local binding 'user' should not cause 'envelop.user.Name' to be flagged as having a redundant qualifier. Closes #1259 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…in with decimal (issue #1362) Adds a negative test case verifying that FSAC/FCS does not offer to remove parentheses around a decimal literal (0.2) when used as an argument in a fluent method chain (bg.lighten(0.2).hexa ()). The upstream fix landed in FCS 43.10.101 via dotnet/fsharp#18350. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
29 tasks
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 PR was created by Repo Assist, an automated AI assistant.
Summary
Adds two regression test cases as requested by the maintainer in issues #1259 and #1362, to verify these false positive code fix scenarios are no longer present.
Test 1:
RemoveRedundantQualifierfalse positive when variable shadows property (issue #1259)Scenario: When a local variable
usershadows theEnvelop.userproperty, FSAC was incorrectly offering the "Remove redundant qualifier" fix onenvelop.user.Name.Test:
checkNotApplicable— verifies the fix is not offered for:If this test fails, the false positive is still present (the fix is still being offered when it shouldn't be). If it passes, the upstream FCS diagnostic is no longer incorrectly emitted for this scenario.
Test 2:
RemoveUnnecessaryParenthesesfalse positive in fluent method chain with decimal literal (issue #1362)Scenario:
bg.lighten(0.2).hexa ()— FSAC was incorrectly offering to remove the parens around0.2, which would produce invalid codebg.lighten 0.2.hexa ().Test:
checkNotApplicable— verifies the fix is not offered forbg.lighten((0.2)).hexa ().The upstream fix landed in FCS 43.10.101 via dotnet/fsharp#18350. This test confirms the fix is in effect.
Test Status
dotnet build test/FsAutoComplete.Tests.Lsp -f net8.0— 0 errorsdotnet fantomas --check— passes