Skip to content

Commit 725e7b3

Browse files
committed
chore(ServerRequestContext): drop ServerRequestContext.FindSymbol
1 parent 79beade commit 725e7b3

File tree

11 files changed

+18
-26
lines changed

11 files changed

+18
-26
lines changed

src/CSharpLanguageServer/Handlers/CallHierarchy.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module CallHierarchy =
2929
: AsyncLspResult<CallHierarchyItem[] option> =
3030
async {
3131
match! context.FindSymbol p.TextDocument.Uri p.Position with
32-
| Some(wf), Some(symbol) when isCallableSymbol symbol ->
32+
| Some(wf), Some(symbol, _, _) when isCallableSymbol symbol ->
3333
let! itemList = CallHierarchyItem.fromSymbol context.ResolveSymbolLocations symbol
3434
return itemList |> List.toArray |> Some |> LspResult.success
3535
| _ -> return None |> LspResult.success
@@ -55,7 +55,7 @@ module CallHierarchy =
5555
FromRanges = fromRanges })
5656

5757
match! context.FindSymbol p.Item.Uri p.Item.Range.Start with
58-
| Some(wf), Some(symbol) ->
58+
| Some(wf), Some(symbol, _, _) ->
5959
let! callers =
6060
SymbolFinder.FindCallersAsync(symbol, wf.Solution.Value, cancellationToken = ct)
6161
|> Async.AwaitTask

src/CSharpLanguageServer/Handlers/CodeLens.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ module CodeLens =
132132
|> Option.defaultValue CodeLensData.Default
133133

134134
match! context.FindSymbol lensData.DocumentUri lensData.Position with
135-
| Some wf, Some symbol ->
135+
| Some wf, Some(symbol, _, _) ->
136136
let! refs =
137137
SymbolFinder.FindReferencesAsync(symbol, wf.Solution.Value, cancellationToken = ct)
138138
|> Async.AwaitTask

src/CSharpLanguageServer/Handlers/Definition.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module Definition =
1616
(p: DefinitionParams)
1717
: Async<LspResult<U2<Definition, DefinitionLink array> option>> =
1818
async {
19-
match! context.FindSymbol' p.TextDocument.Uri p.Position with
19+
match! context.FindSymbol p.TextDocument.Uri p.Position with
2020
| Some wf, Some(symbol, project, _) ->
2121
let! locations, updatedWf = workspaceFolderSymbolLocations symbol (Some project) wf
2222

src/CSharpLanguageServer/Handlers/DocumentHighlight.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ module DocumentHighlight =
5656
Kind = Some DocumentHighlightKind.Read })
5757
}
5858

59-
match! context.FindSymbol' p.TextDocument.Uri p.Position with
59+
match! context.FindSymbol p.TextDocument.Uri p.Position with
6060
| Some wf, Some(symbol, _, Some doc) ->
6161
if shouldHighlight symbol then
6262
let! highlights = getHighlights symbol doc

src/CSharpLanguageServer/Handlers/Hover.fs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ module Hover =
2424
hover |> Some
2525

2626
let handle (context: ServerRequestContext) (p: HoverParams) : AsyncLspResult<Hover option> = async {
27-
let! wf, sym = context.FindSymbol p.TextDocument.Uri p.Position
27+
let! wf, symInfo = context.FindSymbol p.TextDocument.Uri p.Position
2828

29-
match sym with
30-
| Some sym -> return makeHoverForSymbol sym |> LspResult.success
29+
match symInfo with
30+
| Some(sym, _, _) -> return makeHoverForSymbol sym |> LspResult.success
3131
| None -> return None |> LspResult.success
3232
}

src/CSharpLanguageServer/Handlers/Implementation.fs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ module Implementation =
3434
return locations |> Array.collect List.toArray |> Declaration.C2 |> U2.C1 |> Some
3535
}
3636

37-
let! wf, sym = context.FindSymbol p.TextDocument.Uri p.Position
37+
let! wf, symInfo = context.FindSymbol p.TextDocument.Uri p.Position
3838

39-
match wf, sym with
40-
| Some wf, Some sym ->
39+
match wf, symInfo with
40+
| Some wf, Some(sym, _, _) ->
4141
let! impls = findImplementationsOfSymbol wf.Solution.Value sym
4242
return impls |> LspResult.success
4343

src/CSharpLanguageServer/Handlers/References.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module References =
1717
let! ct = Async.CancellationToken
1818

1919
match! context.FindSymbol p.TextDocument.Uri p.Position with
20-
| Some wf, Some symbol ->
20+
| Some wf, Some(symbol, _, _) ->
2121
let! refs =
2222
SymbolFinder.FindReferencesAsync(symbol, wf.Solution.Value, cancellationToken = ct)
2323
|> Async.AwaitTask

src/CSharpLanguageServer/Handlers/Rename.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ module Rename =
148148
}
149149

150150
let handle (context: ServerRequestContext) (p: RenameParams) : AsyncLspResult<WorkspaceEdit option> = async {
151-
match! context.FindSymbol' p.TextDocument.Uri p.Position with
151+
match! context.FindSymbol p.TextDocument.Uri p.Position with
152152
| Some wf, Some(symbol, project, _) ->
153153
let! ct = Async.CancellationToken
154154
let originalSolution = project.Solution

src/CSharpLanguageServer/Handlers/TypeDefinition.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module TypeDefinition =
2020
: Async<LspResult<U2<Definition, DefinitionLink array> option>> =
2121

2222
async {
23-
match! context.FindSymbol' p.TextDocument.Uri p.Position with
23+
match! context.FindSymbol p.TextDocument.Uri p.Position with
2424
| Some wf, Some(symbol, project, _) ->
2525
let typeSymbol =
2626
match symbol with

src/CSharpLanguageServer/Handlers/TypeHierarchy.fs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module TypeHierarchy =
2525
: AsyncLspResult<TypeHierarchyItem[] option> =
2626
async {
2727
match! context.FindSymbol p.TextDocument.Uri p.Position with
28-
| Some wf, Some symbol when isTypeSymbol symbol ->
28+
| Some wf, Some(symbol, _, _) when isTypeSymbol symbol ->
2929
let! itemList = TypeHierarchyItem.fromSymbol context.ResolveSymbolLocations symbol
3030
return itemList |> List.toArray |> Some |> LspResult.success
3131

@@ -38,7 +38,7 @@ module TypeHierarchy =
3838
: AsyncLspResult<TypeHierarchyItem[] option> =
3939
async {
4040
match! context.FindSymbol p.Item.Uri p.Item.Range.Start with
41-
| Some wf, Some symbol when isTypeSymbol symbol ->
41+
| Some wf, Some(symbol, _, _) when isTypeSymbol symbol ->
4242
let typeSymbol = symbol :?> INamedTypeSymbol
4343

4444
let baseType =
@@ -68,7 +68,7 @@ module TypeHierarchy =
6868
let! ct = Async.CancellationToken
6969

7070
match! context.FindSymbol p.Item.Uri p.Item.Range.Start with
71-
| Some wf, Some symbol when isTypeSymbol symbol ->
71+
| Some wf, Some(symbol, _, _) when isTypeSymbol symbol ->
7272
let typeSymbol = symbol :?> INamedTypeSymbol
7373
// We only want immediately derived classes/interfaces/implementations here (we only need
7474
// subclasses not subclasses' subclasses)

0 commit comments

Comments
 (0)