Skip to content

Commit 15c69e1

Browse files
committed
uncomment commented out code and try a test run
1 parent 8a58226 commit 15c69e1

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/FsAutoComplete.Core/InlayHints.fs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -971,8 +971,9 @@ let provideHints
971971
parameterHints.Add hint
972972

973973
| :? FSharpMemberOrFunctionOrValue as methodOrConstructor when
974-
hintConfig.ShowParameterHints && methodOrConstructor.IsConstructor
975-
-> // TODO: support methods when this API comes into FCS
974+
hintConfig.ShowParameterHints
975+
&& (methodOrConstructor.IsMethod || methodOrConstructor.IsConstructor)
976+
->
976977
let endPosForMethod = symbolUse.Range.End
977978
let line, _ = Position.toZ endPosForMethod
978979

@@ -995,13 +996,17 @@ let provideHints
995996
methodOrConstructor.CurriedParameterGroups |> Seq.concat |> Array.ofSeq // TODO: need ArgumentLocations to be surfaced
996997

997998
for idx = 0 to parameters.Length - 1 do
998-
// let paramLocationInfo = tupledParamInfos.ArgumentLocations.[idx]
999+
let paramLocationInfo = tupledParamInfos.ArgumentLocations.[idx]
9991000
let param = parameters.[idx]
10001001
let paramName = param.DisplayName
10011002

1002-
// if shouldCreateHint param && paramLocationInfo.IsNamedArgument then
1003-
// let hint = { Text = paramName + " ="; Pos = paramLocationInfo.ArgumentRange.Start; Kind = Parameter }
1004-
// parameterHints.Add(hint)
1003+
if
1004+
ShouldCreate.paramHint methodOrConstructor param paramName
1005+
&& paramLocationInfo.IsNamedArgument
1006+
then
1007+
let hint = createParamHint paramLocationInfo.ArgumentRange paramName
1008+
parameterHints.Add(hint)
1009+
10051010
()
10061011

10071012
// This will only happen for curried methods defined in F#.
@@ -1018,8 +1023,7 @@ let provideHints
10181023
Some(definitionArgs.[i], v)
10191024
else
10201025
None)
1021-
|> Array.filter Option.isSome
1022-
|> Array.map Option.get
1026+
|> Array.choose id
10231027

10241028
for (definitionArg, appliedArgRange) in parms do
10251029
let! appliedArgText = text[appliedArgRange]

0 commit comments

Comments
 (0)