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

Created on 6 Sep 2018  路  5Comments  路  Source: dotnet/fsharp

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

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


鈥or is autocompletion desired in this case:
2018-09-06_143738


鈥owever 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: c55dd2c3d618eb93a8d16e503947342b1fa93556.
Microsoft Visual F# Tools 10.2 for F# 4.5

Area-IDE Language Service Severity-Low bug

All 5 comments

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) ->
     ...

@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.

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

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

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.

Was this page helpful?
0 / 5 - 0 ratings