Skip to content

Commit 96af0d8

Browse files
authored
Merge pull request #52 from tcx4c70/feat/3.17
Feat/3.17
2 parents e501c06 + c118aa8 commit 96af0d8

File tree

7 files changed

+1104
-91
lines changed

7 files changed

+1104
-91
lines changed

src/Client.fs

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ type ILspClient =
2727
///a particular message.
2828
abstract member WindowLogMessage: LogMessageParams -> Async<unit>
2929

30+
/// The show document request is sent from a server to a client to ask the client to display a particular
31+
/// resource referenced by a URI in the user interface.
32+
abstract member WindowShowDocument: ShowDocumentParams -> AsyncLspResult<ShowDocumentResult>
33+
3034
/// The telemetry notification is sent from the server to the client to ask the client to log
3135
/// a telemetry event.
3236
abstract member TelemetryEvent: Newtonsoft.Json.Linq.JToken -> Async<unit>
@@ -84,6 +88,24 @@ type ILspClient =
8488
abstract member WorkspaceInlayHintRefresh: unit -> Async<unit>
8589

8690

91+
/// The workspace/codeLens/refresh request is sent from the server to the client. Servers can use it to ask
92+
/// clients to refresh the code lenses currently shown in editors. As a result the client should ask the
93+
/// server to recompute the code lenses for these editors. This is useful if a server detects a
94+
/// configuration change which requires a re-calculation of all code lenses. Note that the client still has
95+
/// the freedom to delay the re-calculation of the code lenses if for example an editor is currently not
96+
/// visible.
97+
abstract member WorkspaceCodeLensRefresh: unit -> Async<unit>
98+
99+
100+
/// The workspace/inlineValue/refresh request is sent from the server to the client. Servers can use it to
101+
/// ask clients to refresh the inline values currently shown in editors. As a result the client should ask
102+
/// the server to recompute the inline values for these editors. This is useful if a server detects a
103+
/// configuration change which requires a re-calculation of all inline values. Note that the client still
104+
/// has the freedom to delay the re-calculation of the inline values if for example an editor is currently
105+
/// not visible.
106+
abstract member WorkspaceInlineValueRefresh: unit -> Async<unit>
107+
108+
87109
/// Diagnostics notification are sent from the server to the client to signal results of validation runs.
88110
///
89111
/// Diagnostics are “owned” by the server so it is the server’s responsibility to clear them if necessary.
@@ -100,6 +122,11 @@ type ILspClient =
100122
/// on the client side.
101123
abstract member TextDocumentPublishDiagnostics: PublishDiagnosticsParams -> Async<unit>
102124

125+
/// The workspace/diagnostic/refresh request is sent from the server to the client. Servers can use it to
126+
/// ask clients to refresh all needed document and workspace diagnostics. This is useful if a server detects
127+
/// a project wide configuration change which requires a re-calculation of all diagnostics.
128+
abstract member WorkspaceDiagnosticRefresh: unit -> Async<unit>
129+
103130
/// The window/workDoneProgress/create request is sent from the server to the client to ask the client to create a work done progress.
104131
abstract member WorkDoneProgressCreate: ProgressToken -> AsyncLspResult<unit>
105132

@@ -131,6 +158,12 @@ type LspClient() =
131158

132159
default __.WindowLogMessage(_) = ignoreNotification
133160

161+
/// The show document request is sent from a server to a client to ask the client to display a particular
162+
/// resource referenced by a URI in the user interface.
163+
abstract member WindowShowDocument: ShowDocumentParams -> AsyncLspResult<ShowDocumentResult>
164+
165+
default __.WindowShowDocument(_) = notImplemented
166+
134167
/// The telemetry notification is sent from the server to the client to ask the client to log
135168
/// a telemetry event.
136169
abstract member TelemetryEvent: Newtonsoft.Json.Linq.JToken -> Async<unit>
@@ -199,6 +232,26 @@ type LspClient() =
199232

200233
default __.WorkspaceInlayHintRefresh() = ignoreNotification
201234

235+
/// The workspace/codeLens/refresh request is sent from the server to the client. Servers can use it to ask
236+
/// clients to refresh the code lenses currently shown in editors. As a result the client should ask the
237+
/// server to recompute the code lenses for these editors. This is useful if a server detects a
238+
/// configuration change which requires a re-calculation of all code lenses. Note that the client still has
239+
/// the freedom to delay the re-calculation of the code lenses if for example an editor is currently not
240+
/// visible.
241+
abstract member WorkspaceCodeLensRefresh: unit -> Async<unit>
242+
243+
default __.WorkspaceCodeLensRefresh() = ignoreNotification
244+
245+
/// The workspace/inlineValue/refresh request is sent from the server to the client. Servers can use it to
246+
/// ask clients to refresh the inline values currently shown in editors. As a result the client should ask
247+
/// the server to recompute the inline values for these editors. This is useful if a server detects a
248+
/// configuration change which requires a re-calculation of all inline values. Note that the client still
249+
/// has the freedom to delay the re-calculation of the inline values if for example an editor is currently
250+
/// not visible.
251+
abstract member WorkspaceInlineValueRefresh: unit -> Async<unit>
252+
253+
default __.WorkspaceInlineValueRefresh() = ignoreNotification
254+
202255
/// Diagnostics notification are sent from the server to the client to signal results of validation runs.
203256
///
204257
/// Diagnostics are “owned” by the server so it is the server’s responsibility to clear them if necessary.
@@ -217,6 +270,13 @@ type LspClient() =
217270

218271
default __.TextDocumentPublishDiagnostics(_) = ignoreNotification
219272

273+
/// The workspace/diagnostic/refresh request is sent from the server to the client. Servers can use it to
274+
/// ask clients to refresh all needed document and workspace diagnostics. This is useful if a server detects
275+
/// a project wide configuration change which requires a re-calculation of all diagnostics.
276+
abstract member WorkspaceDiagnosticRefresh: unit -> Async<unit>
277+
278+
default __.WorkspaceDiagnosticRefresh() = ignoreNotification
279+
220280
abstract member Progress: ProgressToken * 'Progress -> Async<unit>
221281

222282
default __.Progress(_, _) = ignoreNotification
@@ -229,6 +289,7 @@ type LspClient() =
229289
member this.WindowShowMessage(p: ShowMessageParams) = this.WindowShowMessage(p)
230290
member this.WindowShowMessageRequest(p: ShowMessageRequestParams) = this.WindowShowMessageRequest(p)
231291
member this.WindowLogMessage(p: LogMessageParams) = this.WindowLogMessage(p)
292+
member this.WindowShowDocument(p: ShowDocumentParams) = this.WindowShowDocument(p)
232293
member this.TelemetryEvent(p: Newtonsoft.Json.Linq.JToken) = this.TelemetryEvent(p)
233294
member this.ClientRegisterCapability(p: RegistrationParams) = this.ClientRegisterCapability(p)
234295
member this.ClientUnregisterCapability(p: UnregistrationParams) = this.ClientUnregisterCapability(p)
@@ -237,6 +298,9 @@ type LspClient() =
237298
member this.WorkspaceApplyEdit(p: ApplyWorkspaceEditParams) = this.WorkspaceApplyEdit(p)
238299
member this.WorkspaceSemanticTokensRefresh() = this.WorkspaceSemanticTokensRefresh()
239300
member this.WorkspaceInlayHintRefresh() = this.WorkspaceInlayHintRefresh()
301+
member this.WorkspaceCodeLensRefresh() = this.WorkspaceCodeLensRefresh()
302+
member this.WorkspaceInlineValueRefresh() = this.WorkspaceInlineValueRefresh()
240303
member this.TextDocumentPublishDiagnostics(p: PublishDiagnosticsParams) = this.TextDocumentPublishDiagnostics(p)
304+
member this.WorkspaceDiagnosticRefresh() = this.WorkspaceDiagnosticRefresh()
241305
member this.WorkDoneProgressCreate(token: ProgressToken) = this.WorkDoneProgressCreate(token)
242306
member this.Progress(token, data) = this.Progress(token, data)

src/LanguageServerProtocol.fs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ module Server =
207207
"completionItem/resolve", requestHandling (fun s p -> s.CompletionItemResolve(p))
208208
"textDocument/rename", requestHandling (fun s p -> s.TextDocumentRename(p))
209209
"textDocument/prepareRename", requestHandling (fun s p -> s.TextDocumentPrepareRename(p))
210+
"textDocument/declaration", requestHandling (fun s p -> s.TextDocumentDeclaration(p))
210211
"textDocument/definition", requestHandling (fun s p -> s.TextDocumentDefinition(p))
211212
"textDocument/typeDefinition", requestHandling (fun s p -> s.TextDocumentTypeDefinition(p))
212213
"textDocument/implementation", requestHandling (fun s p -> s.TextDocumentImplementation(p))
@@ -229,6 +230,8 @@ module Server =
229230
"textDocument/didSave", requestHandling (fun s p -> s.TextDocumentDidSave(p) |> notificationSuccess)
230231
"textDocument/didClose", requestHandling (fun s p -> s.TextDocumentDidClose(p) |> notificationSuccess)
231232
"textDocument/documentSymbol", requestHandling (fun s p -> s.TextDocumentDocumentSymbol(p))
233+
"textDocument/moniker", requestHandling (fun s p -> s.TextDocumentMoniker(p))
234+
"textDocument/linkedEditingRange", requestHandling (fun s p -> s.TextDocumentLinkedEditingRange(p))
232235
"textDocument/foldingRange", requestHandling (fun s p -> s.TextDocumentFoldingRange(p))
233236
"textDocument/selectionRange", requestHandling (fun s p -> s.TextDocumentSelectionRange(p))
234237
"textDocument/prepareCallHierarchy", requestHandling(fun s p -> s.TextDocumentPrepareCallHierarchy(p))
@@ -243,6 +246,7 @@ module Server =
243246
"textDocument/inlayHint", requestHandling (fun s p -> s.TextDocumentInlayHint(p))
244247
"inlayHint/resolve", requestHandling (fun s p -> s.InlayHintResolve(p))
245248
"textDocument/inlineValue", requestHandling (fun s p -> s.TextDocumentInlineValue(p))
249+
"textDocument/diagnostic", requestHandling (fun s p -> s.TextDocumentDiagnostic(p))
246250
"workspace/didChangeWatchedFiles",
247251
requestHandling (fun s p -> s.WorkspaceDidChangeWatchedFiles(p) |> notificationSuccess)
248252
"workspace/didChangeWorkspaceFolders",
@@ -258,8 +262,10 @@ module Server =
258262
"workspace/willDeleteFiles", requestHandling (fun s p -> s.WorkspaceWillDeleteFiles(p))
259263
"workspace/didDeleteFiles", requestHandling (fun s p -> s.WorkspaceDidDeleteFiles(p) |> notificationSuccess)
260264
"workspace/symbol", requestHandling (fun s p -> s.WorkspaceSymbol(p))
265+
"workspaceSymbol/resolve", requestHandling (fun s p -> s.WorkspaceSymbolResolve(p))
261266
"workspace/executeCommand", requestHandling (fun s p -> s.WorkspaceExecuteCommand(p))
262267
"window/workDoneProgress/cancel", requestHandling (fun s p -> s.WorkDoneProgessCancel(p) |> notificationSuccess)
268+
"workspace/diagnostic", requestHandling (fun s p -> s.WorkspaceDiagnostic(p))
263269
"shutdown", requestHandling (fun s () -> s.Shutdown() |> notificationSuccess)
264270
"exit", requestHandling (fun s () -> s.Exit() |> notificationSuccess) ]
265271
|> Map.ofList

0 commit comments

Comments
 (0)