Skip to content

Commit 4024f9c

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

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/FsAutoComplete.Core/InlayHints.fs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -971,8 +971,8 @@ 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 && (methodOrConstructor.IsMethod || methodOrConstructor.IsConstructor)
975+
->
976976
let endPosForMethod = symbolUse.Range.End
977977
let line, _ = Position.toZ endPosForMethod
978978

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

997997
for idx = 0 to parameters.Length - 1 do
998-
// let paramLocationInfo = tupledParamInfos.ArgumentLocations.[idx]
998+
let paramLocationInfo = tupledParamInfos.ArgumentLocations.[idx]
999999
let param = parameters.[idx]
10001000
let paramName = param.DisplayName
10011001

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

10071007
// This will only happen for curried methods defined in F#.
@@ -1018,8 +1018,7 @@ let provideHints
10181018
Some(definitionArgs.[i], v)
10191019
else
10201020
None)
1021-
|> Array.filter Option.isSome
1022-
|> Array.map Option.get
1021+
|> Array.choose id
10231022

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

0 commit comments

Comments
 (0)