File tree Expand file tree Collapse file tree 1 file changed +10
-15
lines changed
src/CSharpLanguageServer/Handlers Expand file tree Collapse file tree 1 file changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -11,22 +11,17 @@ module Implementation =
1111 let provider ( _ : ClientCapabilities ) : U3 < bool , ImplementationOptions , ImplementationRegistrationOptions > option =
1212 Some( U3.C1 true )
1313
14+ let findImplementationsOfSymbol ( context : ServerRequestContext ) sym = async {
15+ let! impls = context.FindImplementations sym
16+ let! locations = impls |> Seq.map ( flip context.ResolveSymbolLocations None) |> Async.Parallel
17+
18+ return locations |> Array.collect List.toArray |> Declaration.C2 |> U2.C1 |> Some
19+ }
20+
1421 let handle
1522 ( context : ServerRequestContext )
1623 ( p : ImplementationParams )
1724 : Async < LspResult < U2 < Definition , DefinitionLink array > option >> =
18- async {
19- match ! context.FindSymbol p.TextDocument.Uri p.Position with
20- | None -> return None |> LspResult.success
21- | Some symbol ->
22- let! impls = context.FindImplementations symbol
23- let! locations = impls |> Seq.map ( flip context.ResolveSymbolLocations None) |> Async.Parallel
24-
25- return
26- locations
27- |> Array.collect List.toArray
28- |> Declaration.C2
29- |> U2.C1
30- |> Some
31- |> LspResult.success
32- }
25+ context.FindSymbol p.TextDocument.Uri p.Position
26+ |> Async.bindOption ( findImplementationsOfSymbol context)
27+ |> Async.map LspResult.success
You can’t perform that action at this time.
0 commit comments