Skip to content

Add missing expr to type annotation - #164

Merged
gnrkr789 merged 1 commit into
mainfrom
160-false-negative-for-parenthesized-and-wildcard-param-types
Jul 3, 2026
Merged

Add missing expr to type annotation#164
gnrkr789 merged 1 commit into
mainfrom
160-false-negative-for-parenthesized-and-wildcard-param-types

Conversation

@gnrkr789

@gnrkr789 gnrkr789 commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Close #160, #161 , #162

  • Remove duplicate warns
  • Fix wrong msg

@gnrkr789 gnrkr789 self-assigned this Jul 3, 2026
Copilot AI review requested due to automatic review settings July 3, 2026 05:09
@gnrkr789 gnrkr789 added bug Something isn't working unittest needed Need to add unit tests labels Jul 3, 2026
@gnrkr789 gnrkr789 linked an issue Jul 3, 2026 that may be closed by this pull request

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses several reported Type Annotation and LSP diagnostic issues by expanding SynType handling for type annotations, removing duplicate diagnostics at the collection layer, and aligning an incorrect LSP line-ending warning message with the existing LineConvention behavior.

Changes:

  • Handle SynType.Paren and SynType.Anon in TypeAnnotationConvention.checkPat to avoid falling through to the “TODO” warning path.
  • Deduplicate diagnostics in Diagnostics.reportWarn when collecting into a LintContext.
  • Add regression tests for paren/anon type annotations and for duplicate : spacing diagnostics; fix the LSP scanWorkspace line-ending message.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/FSLint/TypeAnnotationConvention.fs Adds missing SynType cases for type annotation checking.
src/FSLint/Diagnostics.fs Adds duplicate-diagnostic suppression when accumulating LintContext.Errors.
src/FSLint.Tests/TypeAnnotationTests.fs Adds tests for paren/anon param types and for diagnostic deduplication.
src/FSLint.Tests/Lint.fs Adds helper to lint and return collected errors for assertions.
src/FSLint.LanguageServer/Program.fs Fixes scanWorkspace line-ending warning message text.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/FSLint/TypeAnnotationConvention.fs Outdated
Comment thread src/FSLint/Diagnostics.fs Outdated
  - Remove duplicate warns
  - Fix wrong msg
@gnrkr789
gnrkr789 force-pushed the 160-false-negative-for-parenthesized-and-wildcard-param-types branch from 79073de to 3f41c0d Compare July 3, 2026 05:51
@gnrkr789
gnrkr789 merged commit b8cb3c2 into main Jul 3, 2026
5 checks passed
@gnrkr789
gnrkr789 deleted the 160-false-negative-for-parenthesized-and-wildcard-param-types branch July 3, 2026 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working unittest needed Need to add unit tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False negative for parenthesized and wildcard param types

3 participants