Skip to content

Conversation

edgarfgp
Copy link
Contributor

Superseeds #463

@edgarfgp
Copy link
Contributor Author

edgarfgp commented Sep 15, 2025

There are still some unrelated test failing. So i would wait until this is fixed in main. Based on this comment #945 (comment)

@edgarfgp
Copy link
Contributor Author

@auduchinok Any clues on why all the related test in the CI failed ? with

  Failed Record 01 [461 ms]
  Error Message:
   TearDown : LoggedErrors : No error highlightings found for QuickFix
--- EXCEPTION #1/2 [AssertionException]
Message = “No error highlightings found for QuickFix”

I can see this working locally

Screenshot 2025-09-19 at 11 15 03

@auduchinok
Copy link
Member

@auduchinok Any clues on why all the related test in the CI failed ? with

There may be an error the prevents FCS from reporting the unused pattern one. The test environment is somewhat different from a real project, even though we try to make it similar enough. I should try running it myself to tell more.

@auduchinok
Copy link
Member

@edgarfgp Could you please rebase on main to fix the conflicts?

@edgarfgp
Copy link
Contributor Author

@auduchinok Done. No conflicts though.

if isNotNull trailingComment then trailingComment.PrevSibling
else
if fieldPat.EndLine < nextFieldPat.StartLine then
let beforeNext = getFirstMatchingNodeBefore isInlineSpaceOrComment nextFieldPat
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This branch only executes when the next pattern is on another line. isInlineSpaceOrComment won't go through line separators, so it would only cover some tokens on the next line. Why do we check whitespace/comments on another line when deleting a pattern on the current line?

Why not go to subsequent nodes from the pattern that is being deleted instead? And have you had a chance to test the formatter, as suggested previously? Maybe it can do it all for you after all?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we check whitespace/comments on another line when deleting a pattern on the current line?

Because I have not found a better way to deal with cases like:

Before
match x with
| { F1 = {caret}f1
     // I'm a comment
     F2 = f2 // I'm a comment
     F3 = {caret}}f3} -> ()

After
match x with
| {  // I'm a comment
     F2 = f2
     F3 = f3} -> () 

And have you had a chance to test the formatter, as suggested previously? Maybe it can do it all for you after all?

No. Assuming that you are referring to .FormatNode() function

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. Assuming that you are referring to .FormatNode() function

No, I meant just deleting the meaningful pattern nodes, expecting all the newlines and whitespaces to be handled by the formatter.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, yeah, it doesn't handle this new line yet. I'll need to add some rules to the formatter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Looking forward to finish this PR :)

Copy link
Contributor Author

@edgarfgp edgarfgp Oct 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@auduchinok Anything I can help with to unblock this PR ?

@edgarfgp edgarfgp force-pushed the remove-unused-record-named-pattern-quick-fix branch from f683b20 to dc60995 Compare September 27, 2025 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants