@@ -17,26 +17,36 @@ module ParameterHints =
1717 let mapResult o =
1818 let res = createEmpty< SignatureHelp> ()
1919 let sigs = o.Data.Overloads |> Array.map ( fun c ->
20- let signature = createEmpty< SignatureInformation> ()
21- let tip = c.Tip.[ 0 ].[ 0 ]
22- signature.label <- tip.Signature
23- signature.documentation <- tip.Comment
24- signature.parameters <-
25- c.Parameters |> Array.map ( fun p ->
26- let parameter = createEmpty< ParameterInformation> ()
27- parameter.label <- p.Name
28- parameter.documentation <- p.Description
29- parameter )
30- signature )
20+ try
21+ let signature = createEmpty< SignatureInformation> ()
22+ let tip = c.Tip.[ 0 ].[ 0 ]
23+ signature.label <- tip.Signature
24+ signature.documentation <- tip.Comment
25+ signature.parameters <-
26+ c.Parameters |> Array.map ( fun p ->
27+ let parameter = createEmpty< ParameterInformation> ()
28+ parameter.label <- p.Name
29+ parameter.documentation <- p.Description
30+ parameter )
31+ Some signature
32+ with
33+ | e ->
34+ Globals.console.error e
35+ None) |> Array.choose id
3136 res.activeParameter <- float ( o.Data.CurrentParameter)
3237 res.activeSignature <- 0.
3338 res.signatures <- sigs
3439 res
3540
41+
42+ let logError ( o : obj ) =
43+ Globals.console.error o
44+ null |> unbox< SignatureHelp>
45+
3646 provider.`` provideSignatureHelp <- `` ( fun doc pos _ ->
3747 LanguageService.parse doc.fileName ( doc.getText ())
3848 |> Promise.bind ( fun _ -> LanguageService.methods ( doc.fileName) ( int pos.line + 1 ) ( int pos.character + 1 ))
39- |> Promise.success mapResult
49+ |> Promise.either mapResult logError
4050 |> Promise.toThenable )
4151
4252 provider
0 commit comments