Skip to content

Commit 99f197c

Browse files
committed
move server types to raw interfaces with members matching method names
1 parent 2414bd3 commit 99f197c

File tree

6 files changed

+133
-307
lines changed

6 files changed

+133
-307
lines changed

src/Client.fs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,6 @@ namespace Ionide.LanguageServerProtocol
22

33
open Ionide.LanguageServerProtocol.Types
44

5-
module private ClientUtil =
6-
/// Return the JSON-RPC "not implemented" error
7-
let notImplemented<'t> = async.Return LspResult.notImplemented<'t>
8-
9-
/// Do nothing and ignore the notification
10-
let ignoreNotification = async.Return(())
11-
12-
open ClientUtil
135

146
[<AbstractClass>]
157
type LspClient() =

src/Ionide.LanguageServerProtocol.fsproj

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,34 @@
1818
Namespace changed from FsLibLog to LanguageServerProtocol.Logging per the instructions in that repo.
1919
-->
2020
<Compile Include="FsLibLog.fs" />
21-
<Compile Include="JsonRpc.fs" />
2221
<Compile Include="Types.fs" />
2322
<Compile Include="Client.fs" />
2423
<Compile Include="Server.fs" />
2524
<Compile Include="JsonUtils.fs" />
2625
<Compile Include="LanguageServerProtocol.fs" />
27-
<None Include="../README.md" Pack="true" PackagePath="\" />
26+
<None
27+
Include="../README.md"
28+
Pack="true"
29+
PackagePath="\" />
2830
</ItemGroup>
2931
<ItemGroup>
30-
<PackageReference Include="DotNet.ReproducibleBuilds" Version="1.1.1" PrivateAssets="All" />
31-
<PackageReference Include="Ionide.KeepAChangelog.Tasks" Version="0.1.8" PrivateAssets="All" />
32-
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
32+
<PackageReference
33+
Include="DotNet.ReproducibleBuilds"
34+
Version="1.1.1"
35+
PrivateAssets="All" />
36+
<PackageReference
37+
Include="Ionide.KeepAChangelog.Tasks"
38+
Version="0.1.8"
39+
PrivateAssets="All" />
40+
<PackageReference
41+
Include="Newtonsoft.Json"
42+
Version="13.0.1" />
3343
<!-- Explicitly pinning our FSharp.Core to 6.0.0 so that consumers can use _any_ 6.x version. -->
34-
<PackageReference Update="FSharp.Core" Version="6.0.0" />
35-
<PackageReference Include="StreamJsonRpc" Version="2.10.44" />
44+
<PackageReference
45+
Update="FSharp.Core"
46+
Version="6.0.0" />
47+
<PackageReference
48+
Include="StreamJsonRpc"
49+
Version="2.10.44" />
3650
</ItemGroup>
3751
</Project>

src/JsonRpc.fs

Lines changed: 0 additions & 80 deletions
This file was deleted.

src/LanguageServerProtocol.fs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,9 @@ module Server =
9191
use jsonRpc =
9292
{ new JsonRpc(jsonRpcHandler) with
9393
member this.IsFatalException(ex: Exception) =
94-
match ex with
95-
| :? LocalRpcException -> false
96-
| _ -> true
97-
}
94+
match ex with
95+
| :? LocalRpcException -> false
96+
| _ -> true }
9897

9998
/// When the server wants to send a notification to the client
10099
let sendServerNotification (rpcMethod: string) (notificationObj: obj) : AsyncLspResult<unit> =
@@ -198,18 +197,18 @@ module Server =
198197
"completionItem/resolve", requestHandling (fun s p -> s.CompletionItemResolve(p))
199198
"textDocument/rename", requestHandling (fun s p -> s.TextDocumentRename(p))
200199
"textDocument/prepareRename", requestHandling (fun s p -> s.TextDocumentPrepareRename(p))
201-
"textDocument/definition", requestHandling (fun s p -> s.TextDocumentDefinition(p))
200+
"textDocument/definition", requestHandling (fun s p -> s.``textDocument/definition`` (p))
202201
"textDocument/typeDefinition", requestHandling (fun s p -> s.TextDocumentTypeDefinition(p))
203202
"textDocument/implementation", requestHandling (fun s p -> s.TextDocumentImplementation(p))
204203
"textDocument/codeAction", requestHandling (fun s p -> s.TextDocumentCodeAction(p))
205204
"codeAction/resolve", requestHandling (fun s p -> s.CodeActionResolve(p))
206205
"textDocument/codeLens", requestHandling (fun s p -> s.TextDocumentCodeLens(p))
207206
"codeLens/resolve", requestHandling (fun s p -> s.CodeLensResolve(p))
208-
"textDocument/references", requestHandling (fun s p -> s.TextDocumentReferences(p))
209-
"textDocument/documentHighlight", requestHandling (fun s p -> s.TextDocumentDocumentHighlight(p))
210-
"textDocument/documentLink", requestHandling (fun s p -> s.TextDocumentDocumentLink(p))
207+
"textDocument/references", requestHandling (fun s p -> s.``textDocument/references`` (p))
208+
"textDocument/documentHighlight", requestHandling (fun s p -> s.``textDocument/documentHighlight`` (p))
209+
"textDocument/documentLink", requestHandling (fun s p -> s.``textDocument/documentLink`` (p))
211210
"textDocument/signatureHelp", requestHandling (fun s p -> s.TextDocumentSignatureHelp(p))
212-
"documentLink/resolve", requestHandling (fun s p -> s.DocumentLinkResolve(p))
211+
"documentLink/resolve", requestHandling (fun s p -> s.``documentLink/resolve`` (p))
213212
"textDocument/documentColor", requestHandling (fun s p -> s.TextDocumentDocumentColor(p))
214213
"textDocument/colorPresentation", requestHandling (fun s p -> s.TextDocumentColorPresentation(p))
215214
"textDocument/formatting", requestHandling (fun s p -> s.TextDocumentFormatting(p))

0 commit comments

Comments
 (0)