11namespace Ionide.LanguageServerProtocol
22
33open Ionide.LanguageServerProtocol .Types
4+ open Ionide.LanguageServerProtocol .JsonRpc
45
56module private ClientUtil =
67 /// Return the JSON-RPC "not implemented" error
@@ -11,131 +12,6 @@ module private ClientUtil =
1112
1213open ClientUtil
1314
14- [<Interface>]
15- type ILspClient =
16- /// The show message notification is sent from a server to a client to ask the client to display
17- /// a particular message in the user interface.
18- abstract member WindowShowMessage: ShowMessageParams -> Async < unit >
19-
20- /// The show message request is sent from a server to a client to ask the client to display
21- /// a particular message in the user interface. In addition to the show message notification the
22- /// request allows to pass actions and to wait for an answer from the client.
23- abstract member WindowShowMessageRequest: ShowMessageRequestParams -> AsyncLspResult < MessageActionItem option >
24-
25-
26- /// The log message notification is sent from the server to the client to ask the client to log
27- ///a particular message.
28- abstract member WindowLogMessage: LogMessageParams -> Async < unit >
29-
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-
34- /// The telemetry notification is sent from the server to the client to ask the client to log
35- /// a telemetry event.
36- abstract member TelemetryEvent: Newtonsoft.Json.Linq.JToken -> Async < unit >
37-
38- /// The `client/registerCapability` request is sent from the server to the client to register for a new
39- /// capability on the client side. Not all clients need to support dynamic capability registration.
40- /// A client opts in via the dynamicRegistration property on the specific client capabilities. A client
41- /// can even provide dynamic registration for capability A but not for capability B.
42- abstract member ClientRegisterCapability: RegistrationParams -> AsyncLspResult < unit >
43-
44- /// The `client/unregisterCapability` request is sent from the server to the client to unregister a previously
45- /// registered capability.
46- abstract member ClientUnregisterCapability: UnregistrationParams -> AsyncLspResult < unit >
47-
48-
49- /// Many tools support more than one root folder per workspace. Examples for this are VS Code’s multi-root
50- /// support, Atom’s project folder support or Sublime’s project support. If a client workspace consists of
51- /// multiple roots then a server typically needs to know about this. The protocol up to know assumes one root
52- /// folder which is announce to the server by the rootUri property of the InitializeParams.
53- /// If the client supports workspace folders and announces them via the corresponding workspaceFolders client
54- /// capability the InitializeParams contain an additional property workspaceFolders with the configured
55- /// workspace folders when the server starts.
56- ///
57- /// The workspace/workspaceFolders request is sent from the server to the client to fetch the current open
58- /// list of workspace folders. Returns null in the response if only a single file is open in the tool.
59- /// Returns an empty array if a workspace is open but no folders are configured.
60- abstract member WorkspaceWorkspaceFolders: unit -> AsyncLspResult < WorkspaceFolder [] option >
61-
62- /// The workspace/configuration request is sent from the server to the client to fetch configuration
63- /// settings from the client.
64- ///
65- /// The request can fetch n configuration settings in one roundtrip. The order of the returned configuration
66- /// settings correspond to the order of the passed ConfigurationItems (e.g. the first item in the response
67- /// is the result for the first configuration item in the params).
68- abstract member WorkspaceConfiguration: ConfigurationParams -> AsyncLspResult < Newtonsoft.Json.Linq.JToken []>
69-
70-
71- abstract member WorkspaceApplyEdit: ApplyWorkspaceEditParams -> AsyncLspResult < ApplyWorkspaceEditResult >
72-
73- /// The workspace/semanticTokens/refresh request is sent from the server to the client.
74- /// Servers can use it to ask clients to refresh the editors for which this server provides semantic tokens.
75- /// As a result the client should ask the server to recompute the semantic tokens for these editors.
76- /// This is useful if a server detects a project wide configuration change which requires a re-calculation
77- /// of all semantic tokens. Note that the client still has the freedom to delay the re-calculation of
78- /// the semantic tokens if for example an editor is currently not visible.
79- abstract member WorkspaceSemanticTokensRefresh: unit -> Async < unit >
80-
81-
82- /// The `workspace/inlayHint/refresh` request is sent from the server to the client.
83- /// Servers can use it to ask clients to refresh the inlay hints currently shown in editors.
84- /// As a result the client should ask the server to recompute the inlay hints for these editors.
85- /// This is useful if a server detects a configuration change which requires a re-calculation
86- /// of all inlay hints. Note that the client still has the freedom to delay the re-calculation of the inlay hints
87- /// if for example an editor is currently not visible.
88- abstract member WorkspaceInlayHintRefresh: unit -> Async < unit >
89-
90-
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-
109- /// Diagnostics notification are sent from the server to the client to signal results of validation runs.
110- ///
111- /// Diagnostics are “owned” by the server so it is the server’s responsibility to clear them if necessary.
112- /// The following rule is used for VS Code servers that generate diagnostics:
113- ///
114- /// * if a language is single file only (for example HTML) then diagnostics are cleared by the server when
115- /// the file is closed.
116- /// * if a language has a project system (for example C#) diagnostics are not cleared when a file closes.
117- /// When a project is opened all diagnostics for all files are recomputed (or read from a cache).
118- ///
119- /// When a file changes it is the server’s responsibility to re-compute diagnostics and push them to the
120- /// client. If the computed set is empty it has to push the empty array to clear former diagnostics.
121- /// Newly pushed diagnostics always replace previously pushed diagnostics. There is no merging that happens
122- /// on the client side.
123- abstract member TextDocumentPublishDiagnostics: PublishDiagnosticsParams -> Async < unit >
124-
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-
130- /// The window/workDoneProgress/create request is sent from the server to the client to ask the client to create a work done progress.
131- abstract member WorkDoneProgressCreate: ProgressToken -> AsyncLspResult < unit >
132-
133- /// The base protocol offers also support to report progress in a generic fashion.
134- /// This mechanism can be used to report any kind of progress including work done progress
135- /// (usually used to report progress in the user interface using a progress bar) and
136- /// partial result progress to support streaming of results.
137- abstract member Progress: ProgressToken * 'Progress -> Async < unit >
138-
13915[<AbstractClass>]
14016type LspClient () =
14117
@@ -218,39 +94,39 @@ type LspClient() =
21894 /// This is useful if a server detects a project wide configuration change which requires a re-calculation
21995 /// of all semantic tokens. Note that the client still has the freedom to delay the re-calculation of
22096 /// the semantic tokens if for example an editor is currently not visible.
221- abstract member WorkspaceSemanticTokensRefresh: unit -> Async < unit >
97+ abstract member WorkspaceSemanticTokensRefresh: unit -> AsyncLspResult < unit >
22298
223- default __.WorkspaceSemanticTokensRefresh () = ignoreNotification
99+ default __.WorkspaceSemanticTokensRefresh () = notImplemented
224100
225101 /// The `workspace/inlayHint/refresh` request is sent from the server to the client.
226102 /// Servers can use it to ask clients to refresh the inlay hints currently shown in editors.
227103 /// As a result the client should ask the server to recompute the inlay hints for these editors.
228104 /// This is useful if a server detects a configuration change which requires a re-calculation
229105 /// of all inlay hints. Note that the client still has the freedom to delay the re-calculation of the inlay hints
230106 /// if for example an editor is currently not visible.
231- abstract member WorkspaceInlayHintRefresh: unit -> Async < unit >
107+ abstract member WorkspaceInlayHintRefresh: unit -> AsyncLspResult < unit >
232108
233- default __.WorkspaceInlayHintRefresh () = ignoreNotification
109+ default __.WorkspaceInlayHintRefresh () = notImplemented
234110
235111 /// The workspace/codeLens/refresh request is sent from the server to the client. Servers can use it to ask
236112 /// clients to refresh the code lenses currently shown in editors. As a result the client should ask the
237113 /// server to recompute the code lenses for these editors. This is useful if a server detects a
238114 /// configuration change which requires a re-calculation of all code lenses. Note that the client still has
239115 /// the freedom to delay the re-calculation of the code lenses if for example an editor is currently not
240116 /// visible.
241- abstract member WorkspaceCodeLensRefresh: unit -> Async < unit >
117+ abstract member WorkspaceCodeLensRefresh: unit -> AsyncLspResult < unit >
242118
243- default __.WorkspaceCodeLensRefresh () = ignoreNotification
119+ default __.WorkspaceCodeLensRefresh () = notImplemented
244120
245121 /// The workspace/inlineValue/refresh request is sent from the server to the client. Servers can use it to
246122 /// ask clients to refresh the inline values currently shown in editors. As a result the client should ask
247123 /// the server to recompute the inline values for these editors. This is useful if a server detects a
248124 /// configuration change which requires a re-calculation of all inline values. Note that the client still
249125 /// has the freedom to delay the re-calculation of the inline values if for example an editor is currently
250126 /// not visible.
251- abstract member WorkspaceInlineValueRefresh: unit -> Async < unit >
127+ abstract member WorkspaceInlineValueRefresh: unit -> AsyncLspResult < unit >
252128
253- default __.WorkspaceInlineValueRefresh () = ignoreNotification
129+ default __.WorkspaceInlineValueRefresh () = notImplemented
254130
255131 /// Diagnostics notification are sent from the server to the client to signal results of validation runs.
256132 ///
@@ -273,17 +149,23 @@ type LspClient() =
273149 /// The workspace/diagnostic/refresh request is sent from the server to the client. Servers can use it to
274150 /// ask clients to refresh all needed document and workspace diagnostics. This is useful if a server detects
275151 /// a project wide configuration change which requires a re-calculation of all diagnostics.
276- abstract member WorkspaceDiagnosticRefresh: unit -> Async < unit >
152+ abstract member WorkspaceDiagnosticRefresh: unit -> AsyncLspResult < unit >
153+
154+ default __.WorkspaceDiagnosticRefresh () = notImplemented
155+
156+ abstract member Progress: ProgressParams -> Async < unit >
277157
278- default __.WorkspaceDiagnosticRefresh ( ) = ignoreNotification
158+ default __.Progress ( p ) = ignoreNotification
279159
280- abstract member Progress: ProgressToken * 'Progress -> Async < unit >
160+ abstract member CancelRequest: CancelParams -> Async < unit >
161+ default __.CancelRequest ( _ ) = ignoreNotification
281162
282- default __.Progress ( _ , _ ) = ignoreNotification
163+ abstract member LogTrace: LogTraceParams -> Async < unit >
164+ default __.LogTrace ( _ ) = ignoreNotification
283165
284166 /// The window/workDoneProgress/create request is sent from the server to the client to ask the client to create a work done progress.
285- abstract member WorkDoneProgressCreate: ProgressToken -> AsyncLspResult < unit >
286- default __.WorkDoneProgressCreate ( _ ) = notImplemented
167+ abstract member WindowWorkDoneProgressCreate: WorkDoneProgressCreateParams -> AsyncLspResult < unit >
168+ default __.WindowWorkDoneProgressCreate ( _ ) = notImplemented
287169
288170 interface ILspClient with
289171 member this.WindowShowMessage ( p : ShowMessageParams ) = this.WindowShowMessage( p)
@@ -302,5 +184,8 @@ type LspClient() =
302184 member this.WorkspaceInlineValueRefresh () = this.WorkspaceInlineValueRefresh()
303185 member this.TextDocumentPublishDiagnostics ( p : PublishDiagnosticsParams ) = this.TextDocumentPublishDiagnostics( p)
304186 member this.WorkspaceDiagnosticRefresh () = this.WorkspaceDiagnosticRefresh()
305- member this.WorkDoneProgressCreate ( token : ProgressToken ) = this.WorkDoneProgressCreate( token)
306- member this.Progress ( token , data ) = this.Progress( token, data)
187+ member this.WindowWorkDoneProgressCreate ( p : WorkDoneProgressCreateParams ) = this.WindowWorkDoneProgressCreate( p)
188+ member this.Progress ( p : ProgressParams ) = this.Progress( p)
189+ member this.CancelRequest ( p : CancelParams ) : Async < unit > = this.CancelRequest( p)
190+ member this.LogTrace ( p : LogTraceParams ) : Async < unit > = this.LogTrace( p)
191+ member this.Dispose () : unit = ()
0 commit comments