Skip to content

Visual Studio : When defining names in pattern matching auto completion should not be triggered. #5594

Description

@goswinr

When binding values to names in pattern matching autocompletion gets triggered but should not.

•in this case autocompletion is not desired:
2018-09-06_143700
(update: DU and Enums are an exception to that as mentioned by @rojepp below)


•nor is autocompletion desired in this case:
2018-09-06_143738


•however when matching on types autocompletion might be desired:
2018-09-06_143718


As expected, autocompletion is not triggerd when binding a values to name with let or fun .

Microsoft Visual Studio Community 2017
Version 15.8.2
VisualStudio.15.Release/15.8.2+28010.2016
Microsoft .NET Framework
Version 4.7.03062

Visual F# Tools 10.2 for F# 4.5 15.8.0.0. Commit Hash: c55dd2c.
Microsoft Visual F# Tools 10.2 for F# 4.5

Activity

  1. added this to the 16.0 milestone on Sep 7, 2018
  2. rojepp commented on Sep 7, 2018

    @rojepp
    Contributor

    In your first example, I'd expect a filtered list showing only types. You often match for a DU and assign names inside.

         match smth with
         | Call(None, methInfo, args) ->
         ...
  3. goswinr commented on Sep 7, 2018

    @goswinr
    ContributorAuthor

    @rojepp a distinction between typing a DU/Enum or a new name could be made when the first letter is typed in upper or lower case.

  4. added
    Impact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.
    on Sep 13, 2018
  5. dsyme commented on Sep 13, 2018

    @dsyme
    Contributor

    It would be great to have this fixed (I notice it quite often but just mentally ignore it after too long)

  6. goswinr commented on Oct 1, 2018

    @goswinr
    ContributorAuthor

    similarly the x in for x in xs do should probably not trigger autocompletion`.
    At least if it is lower case ( not a DU)
    image

  7. modified the milestones: 16.0, 16.1 on Feb 21, 2019
  8. cartermp commented on Apr 6, 2019

    @cartermp
    Contributor

    This is significantly less annoying in VS 2019 GA for thefor x in ... case:

    image

    The match case issue remains, though we reduced the noise in completion in general so you should see a lot less useless stuff there.

  9. removed
    Impact-Medium(Internal MS Team use only) Describes an issue with moderate impact on existing code.
    on Apr 6, 2019
  10. modified the milestones: 16.1, 16.2 on Apr 23, 2019
  11. removed this from the 16.2 milestone on Apr 30, 2019
  12. 3 remaining items

  13. kerams commented on Apr 13, 2022

    @kerams
    Contributor

    The right side of as is also a pattern, so completions could be desirable.

  14. github-actions commented on Sep 29, 2026

    @github-actions
    Contributor

    🤖 This is an automated response from Repo Assist.

    This issue is testable cross-platform through FSharp.Compiler.Service: completion is produced by GetDeclarationListInfo, and the repository test helper Checker.getCompletionInfo exercises that API directly. I have therefore removed the AI-thinks-windows-only label.

    The issue still reproduces at current HEAD 9b0b8a44015743b1c6a05fc0a739dfcddcf353ba (committed 2026-09-29, less than one day old). A focused FCS test run used these caret positions and expected zero completion items:

    • match A 1 with | A value{caret} -> (): 205 items
    • for value{caret} in [ 1 ] do (): 202 items
    • match box 1 with | :? int as value{caret} -> () | _ -> (): 202 items

    The exact command was dotnet test tests/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj --filter-method '*Issue 5594*' -c Release. The temporary probe failed as expected and was removed, so no regression-test PR was opened.

    Current compiler proof from built fsi and #version;;:

    F# Interactive version 15.2.200.0 for F# 11.2
    FSharp.Core version 11.0.0.0
    .NET Runtime version 11.0.0-rc.1.26420.103
    Linux x64
    

    This remains an open FCS completion bug rather than Visual Studio-specific behavior.

    Warning

    Firewall blocked 1 domain

    The following domain was blocked by the firewall during workflow execution:

    • southcentralus0.in.applicationinsights.azure.com

    To allow these domains, add them to the network.allowed list in your workflow frontmatter:

    network:
      allowed:
        - defaults
        - "southcentralus0.in.applicationinsights.azure.com"

    See Network Configuration for more information.

    Generated by 🌈 Repo Assist, see workflow run. Learn more.

    Add this agentic workflows to your repo

    To install this agentic workflow, run

    gh aw add githubnext/agentics/workflows/repo-assist.md@7c7feb61a52b662eb2089aa2945588b7a200d404
    
  15. goswinr commented on Sep 29, 2026

    @goswinr
    ContributorAuthor

    closing old issue. using VS code now. not VS anymore

  16. goswinr commented on Sep 29, 2026

    @goswinr
    ContributorAuthor

    actually, if it is in FCS , keep it open

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-LangService-AutoCompleteautocomplete/intellisenseBugImpact-Low(Internal MS Team use only) Describes an issue with limited impact on existing code.

    Type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions