File tree Expand file tree Collapse file tree 1 file changed +13
-15
lines changed
src/CSharpLanguageServer/Handlers Expand file tree Collapse file tree 1 file changed +13
-15
lines changed Original file line number Diff line number Diff line change @@ -5,24 +5,22 @@ open Ionide.LanguageServerProtocol.JsonRpc
55
66open CSharpLanguageServer
77open CSharpLanguageServer.State
8+ open CSharpLanguageServer.Util
89
910[<RequireQualifiedAccess>]
1011module Hover =
11- let provider ( _ : ClientCapabilities ) : U2 < bool , HoverOptions > option = Some( U2.C1 true )
12+ let provider ( _cc : ClientCapabilities ) : U2 < bool , HoverOptions > option = Some( U2.C1 true )
1213
13- let handle ( context : ServerRequestContext ) ( p : HoverParams ) : AsyncLspResult < Hover option > = async {
14- match ! context.FindSymbol' p.TextDocument.Uri p.Position with
15- | None -> return None |> LspResult.success
16- | Some( symbol, _, _) ->
17- let content = DocumentationUtil.markdownDocForSymbolWithSignature symbol
14+ let makeHoverForSymbol symbol =
15+ let content = DocumentationUtil.markdownDocForSymbolWithSignature symbol
1816
19- let hover =
20- { Contents =
21- { Kind = MarkupKind.Markdown
22- Value = content }
23- |> U3.C1
24- // TODO: Support range
25- Range = None }
17+ { Contents =
18+ { Kind = MarkupKind.Markdown
19+ Value = content }
20+ |> U3.C1
21+ Range = None } // TODO: Support range
2622
27- return hover |> Some |> LspResult.success
28- }
23+ let handle ( context : ServerRequestContext ) ( p : HoverParams ) : AsyncLspResult < Hover option > =
24+ context.FindSymbol p.TextDocument.Uri p.Position
25+ |> Async.map ( Option.map makeHoverForSymbol)
26+ |> Async.map LspResult.success
You can’t perform that action at this time.
0 commit comments