Skip to content

Commit 61c4255

Browse files
Merge pull request #50 from OmniSharp/refactor/protocol
[Breaking] Split protocol into it's own project
2 parents 8ec355f + eb2ff5d commit 61c4255

File tree

454 files changed

+1409
-1363
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

454 files changed

+1409
-1363
lines changed

LSP.sln

+31-16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
22
# Visual Studio 15
3-
VisualStudioVersion = 15.0.26730.16
3+
VisualStudioVersion = 15.0.27004.2009
44
MinimumVisualStudioVersion = 10.0.40219.1
55
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{D764E024-3D3F-4112-B932-2DB722A1BACC}"
66
EndProject
@@ -21,8 +21,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".config", ".config", "{AE4D
2121
EndProject
2222
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JsonRpc", "src\JsonRpc\JsonRpc.csproj", "{9AF43FA2-EF35-435E-B59E-724877E44DDA}"
2323
EndProject
24-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lsp", "src\Lsp\Lsp.csproj", "{50EA648A-67D3-4127-9517-EC7C1426E2E7}"
25-
EndProject
2624
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JsonRpc.Tests", "test\JsonRpc.Tests\JsonRpc.Tests.csproj", "{35F9B883-36D0-4F3B-A191-9BBD05B798A7}"
2725
EndProject
2826
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lsp.Tests", "test\Lsp.Tests\Lsp.Tests.csproj", "{482B180B-FD5C-4705-BBE1-094C905F1E1F}"
@@ -35,6 +33,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Client", "src\Client\Client
3533
EndProject
3634
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Client.Tests", "test\Client.Tests\Client.Tests.csproj", "{97437BE1-2EC3-4F6B-AC75-C3E099040A07}"
3735
EndProject
36+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Protocol", "src\Protocol\Protocol.csproj", "{92B331E9-5225-428D-AE82-37F5F46156A3}"
37+
EndProject
38+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Server", "src\Server\Server.csproj", "{E540868F-438E-4F7F-BBB7-010D6CB18A57}"
39+
EndProject
3840
Global
3941
GlobalSection(SolutionConfigurationPlatforms) = preSolution
4042
Debug|Any CPU = Debug|Any CPU
@@ -57,18 +59,6 @@ Global
5759
{9AF43FA2-EF35-435E-B59E-724877E44DDA}.Release|x64.Build.0 = Release|Any CPU
5860
{9AF43FA2-EF35-435E-B59E-724877E44DDA}.Release|x86.ActiveCfg = Release|Any CPU
5961
{9AF43FA2-EF35-435E-B59E-724877E44DDA}.Release|x86.Build.0 = Release|Any CPU
60-
{50EA648A-67D3-4127-9517-EC7C1426E2E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
61-
{50EA648A-67D3-4127-9517-EC7C1426E2E7}.Debug|Any CPU.Build.0 = Debug|Any CPU
62-
{50EA648A-67D3-4127-9517-EC7C1426E2E7}.Debug|x64.ActiveCfg = Debug|Any CPU
63-
{50EA648A-67D3-4127-9517-EC7C1426E2E7}.Debug|x64.Build.0 = Debug|Any CPU
64-
{50EA648A-67D3-4127-9517-EC7C1426E2E7}.Debug|x86.ActiveCfg = Debug|Any CPU
65-
{50EA648A-67D3-4127-9517-EC7C1426E2E7}.Debug|x86.Build.0 = Debug|Any CPU
66-
{50EA648A-67D3-4127-9517-EC7C1426E2E7}.Release|Any CPU.ActiveCfg = Release|Any CPU
67-
{50EA648A-67D3-4127-9517-EC7C1426E2E7}.Release|Any CPU.Build.0 = Release|Any CPU
68-
{50EA648A-67D3-4127-9517-EC7C1426E2E7}.Release|x64.ActiveCfg = Release|Any CPU
69-
{50EA648A-67D3-4127-9517-EC7C1426E2E7}.Release|x64.Build.0 = Release|Any CPU
70-
{50EA648A-67D3-4127-9517-EC7C1426E2E7}.Release|x86.ActiveCfg = Release|Any CPU
71-
{50EA648A-67D3-4127-9517-EC7C1426E2E7}.Release|x86.Build.0 = Release|Any CPU
7262
{35F9B883-36D0-4F3B-A191-9BBD05B798A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
7363
{35F9B883-36D0-4F3B-A191-9BBD05B798A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
7464
{35F9B883-36D0-4F3B-A191-9BBD05B798A7}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -129,18 +119,43 @@ Global
129119
{97437BE1-2EC3-4F6B-AC75-C3E099040A07}.Release|x64.Build.0 = Release|Any CPU
130120
{97437BE1-2EC3-4F6B-AC75-C3E099040A07}.Release|x86.ActiveCfg = Release|Any CPU
131121
{97437BE1-2EC3-4F6B-AC75-C3E099040A07}.Release|x86.Build.0 = Release|Any CPU
122+
{92B331E9-5225-428D-AE82-37F5F46156A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
123+
{92B331E9-5225-428D-AE82-37F5F46156A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
124+
{92B331E9-5225-428D-AE82-37F5F46156A3}.Debug|x64.ActiveCfg = Debug|Any CPU
125+
{92B331E9-5225-428D-AE82-37F5F46156A3}.Debug|x64.Build.0 = Debug|Any CPU
126+
{92B331E9-5225-428D-AE82-37F5F46156A3}.Debug|x86.ActiveCfg = Debug|Any CPU
127+
{92B331E9-5225-428D-AE82-37F5F46156A3}.Debug|x86.Build.0 = Debug|Any CPU
128+
{92B331E9-5225-428D-AE82-37F5F46156A3}.Release|Any CPU.ActiveCfg = Release|Any CPU
129+
{92B331E9-5225-428D-AE82-37F5F46156A3}.Release|Any CPU.Build.0 = Release|Any CPU
130+
{92B331E9-5225-428D-AE82-37F5F46156A3}.Release|x64.ActiveCfg = Release|Any CPU
131+
{92B331E9-5225-428D-AE82-37F5F46156A3}.Release|x64.Build.0 = Release|Any CPU
132+
{92B331E9-5225-428D-AE82-37F5F46156A3}.Release|x86.ActiveCfg = Release|Any CPU
133+
{92B331E9-5225-428D-AE82-37F5F46156A3}.Release|x86.Build.0 = Release|Any CPU
134+
{E540868F-438E-4F7F-BBB7-010D6CB18A57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
135+
{E540868F-438E-4F7F-BBB7-010D6CB18A57}.Debug|Any CPU.Build.0 = Debug|Any CPU
136+
{E540868F-438E-4F7F-BBB7-010D6CB18A57}.Debug|x64.ActiveCfg = Debug|Any CPU
137+
{E540868F-438E-4F7F-BBB7-010D6CB18A57}.Debug|x64.Build.0 = Debug|Any CPU
138+
{E540868F-438E-4F7F-BBB7-010D6CB18A57}.Debug|x86.ActiveCfg = Debug|Any CPU
139+
{E540868F-438E-4F7F-BBB7-010D6CB18A57}.Debug|x86.Build.0 = Debug|Any CPU
140+
{E540868F-438E-4F7F-BBB7-010D6CB18A57}.Release|Any CPU.ActiveCfg = Release|Any CPU
141+
{E540868F-438E-4F7F-BBB7-010D6CB18A57}.Release|Any CPU.Build.0 = Release|Any CPU
142+
{E540868F-438E-4F7F-BBB7-010D6CB18A57}.Release|x64.ActiveCfg = Release|Any CPU
143+
{E540868F-438E-4F7F-BBB7-010D6CB18A57}.Release|x64.Build.0 = Release|Any CPU
144+
{E540868F-438E-4F7F-BBB7-010D6CB18A57}.Release|x86.ActiveCfg = Release|Any CPU
145+
{E540868F-438E-4F7F-BBB7-010D6CB18A57}.Release|x86.Build.0 = Release|Any CPU
132146
EndGlobalSection
133147
GlobalSection(SolutionProperties) = preSolution
134148
HideSolutionNode = FALSE
135149
EndGlobalSection
136150
GlobalSection(NestedProjects) = preSolution
137151
{9AF43FA2-EF35-435E-B59E-724877E44DDA} = {D764E024-3D3F-4112-B932-2DB722A1BACC}
138-
{50EA648A-67D3-4127-9517-EC7C1426E2E7} = {D764E024-3D3F-4112-B932-2DB722A1BACC}
139152
{35F9B883-36D0-4F3B-A191-9BBD05B798A7} = {2F323ED5-EBF8-45E1-B9D3-C014561B3DDA}
140153
{482B180B-FD5C-4705-BBE1-094C905F1E1F} = {2F323ED5-EBF8-45E1-B9D3-C014561B3DDA}
141154
{F2067F5F-FA4E-4990-B301-E7898FC4C45F} = {A316FCEC-81AD-45FB-93EE-C62CA09300DC}
142155
{417E95B2-5AB9-49D5-B7CD-12255472E2E7} = {D764E024-3D3F-4112-B932-2DB722A1BACC}
143156
{97437BE1-2EC3-4F6B-AC75-C3E099040A07} = {2F323ED5-EBF8-45E1-B9D3-C014561B3DDA}
157+
{92B331E9-5225-428D-AE82-37F5F46156A3} = {D764E024-3D3F-4112-B932-2DB722A1BACC}
158+
{E540868F-438E-4F7F-BBB7-010D6CB18A57} = {D764E024-3D3F-4112-B932-2DB722A1BACC}
144159
EndGlobalSection
145160
GlobalSection(ExtensibilityGlobals) = postSolution
146161
SolutionGuid = {D38DD0EC-D095-4BCD-B8AF-2D788AF3B9AE}

sample/SampleServer/Program.cs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Threading.Tasks;
44
using Microsoft.Extensions.Logging;
55
using OmniSharp.Extensions.LanguageServer;
6+
using OmniSharp.Extensions.LanguageServer.Server;
67

78
namespace SampleServer
89
{

sample/SampleServer/SampleServer.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<ProjectReference Include="../../src/Lsp/Lsp.csproj" />
10+
<ProjectReference Include="../../src/Server/Server.csproj" />
1111
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.0.0" />
1212
</ItemGroup>
1313

sample/SampleServer/TextDocumentHandler.cs

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
using System;
22
using System.Threading.Tasks;
33
using OmniSharp.Extensions.LanguageServer;
4-
using OmniSharp.Extensions.LanguageServer.Abstractions;
5-
using OmniSharp.Extensions.LanguageServer.Capabilities.Client;
6-
using OmniSharp.Extensions.LanguageServer.Capabilities.Server;
7-
using OmniSharp.Extensions.LanguageServer.Models;
84
using OmniSharp.Extensions.LanguageServer.Protocol;
9-
using OmniSharp.Extensions.LanguageServer.Protocol.Document;
5+
using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities;
6+
using OmniSharp.Extensions.LanguageServer.Protocol.Models;
7+
using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities;
8+
using OmniSharp.Extensions.LanguageServer.Server;
109

1110
namespace SampleServer
1211
{
@@ -105,4 +104,4 @@ public TextDocumentAttributes GetTextDocumentAttributes(Uri uri)
105104
return new TextDocumentAttributes(uri, "csharp");
106105
}
107106
}
108-
}
107+
}

src/Client/Client.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<TargetFrameworks>netstandard2.0</TargetFrameworks>
55
<PlatformTarget>AnyCPU</PlatformTarget>
66
<AssemblyName>OmniSharp.Extensions.LanguageClient</AssemblyName>
7-
<RootNamespace>OmniSharp.Extensions.LanguageServerProtocol.Client</RootNamespace>
7+
<RootNamespace>OmniSharp.Extensions.LanguageServer.Client</RootNamespace>
88
</PropertyGroup>
99

1010
<ItemGroup>
@@ -16,6 +16,6 @@
1616

1717
<ItemGroup>
1818
<ProjectReference Include="..\JsonRpc\JsonRpc.csproj" />
19-
<ProjectReference Include="..\Lsp\Lsp.csproj" />
19+
<ProjectReference Include="..\Protocol\Protocol.csproj" />
2020
</ItemGroup>
2121
</Project>

src/Client/Clients/TextDocumentClient.Completions.cs

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
using OmniSharp.Extensions.LanguageServer.Models;
2-
using OmniSharp.Extensions.LanguageServerProtocol.Client.Utilities;
31
using System;
42
using System.Threading;
53
using System.Threading.Tasks;
4+
using OmniSharp.Extensions.LanguageServer.Client.Utilities;
5+
using OmniSharp.Extensions.LanguageServer.Protocol;
6+
using OmniSharp.Extensions.LanguageServer.Protocol.Models;
67

7-
namespace OmniSharp.Extensions.LanguageServerProtocol.Client.Clients
8+
namespace OmniSharp.Extensions.LanguageServer.Client.Clients
89
{
910
/// <summary>
1011
/// Client for the LSP Text Document API.
@@ -31,7 +32,7 @@ public partial class TextDocumentClient
3132
/// </returns>
3233
public Task<CompletionList> Completions(string filePath, int line, int column, CancellationToken cancellationToken = default(CancellationToken))
3334
{
34-
if (String.IsNullOrWhiteSpace(filePath))
35+
if (string.IsNullOrWhiteSpace(filePath))
3536
throw new ArgumentException($"Argument cannot be null, empty, or entirely composed of whitespace: {nameof(filePath)}.", nameof(filePath));
3637

3738
Uri documentUri = DocumentUri.FromFileSystemPath(filePath);
@@ -59,7 +60,7 @@ public partial class TextDocumentClient
5960
/// </returns>
6061
public Task<CompletionList> Completions(Uri documentUri, int line, int column, CancellationToken cancellationToken = default(CancellationToken))
6162
{
62-
return PositionalRequest<CompletionList>("textDocument/completion", documentUri, line, column, cancellationToken);
63+
return PositionalRequest<CompletionList>(DocumentNames.Completion, documentUri, line, column, cancellationToken);
6364
}
6465
}
6566
}

src/Client/Clients/TextDocumentClient.Diagnostics.cs

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
using OmniSharp.Extensions.LanguageServer.Models;
21
using System;
32
using System.Collections.Generic;
4-
using System.IO;
5-
using System.Threading;
6-
using System.Threading.Tasks;
3+
using OmniSharp.Extensions.LanguageServer.Protocol;
4+
using OmniSharp.Extensions.LanguageServer.Protocol.Models;
75

8-
namespace OmniSharp.Extensions.LanguageServerProtocol.Client.Clients
6+
namespace OmniSharp.Extensions.LanguageServer.Client.Clients
97
{
108
/// <summary>
119
/// Client for the LSP Text Document API.
@@ -29,12 +27,13 @@ public IDisposable OnPublishDiagnostics(PublishDiagnosticsHandler handler)
2927
if (handler == null)
3028
throw new ArgumentNullException(nameof(handler));
3129

32-
return Client.HandleNotification<PublishDiagnosticsParams>("textDocument/publishDiagnostics", notification =>
30+
return Client.HandleNotification<PublishDiagnosticsParams>(DocumentNames.PublishDiagnostics, notification =>
3331
{
32+
if (notification.Diagnostics == null)
3433
if (notification.Diagnostics == null)
3534
return; // Invalid notification.
3635

37-
List<Diagnostic> diagnostics = new List<Diagnostic>();
36+
var diagnostics = new List<Diagnostic>();
3837
if (notification.Diagnostics != null)
3938
diagnostics.AddRange(notification.Diagnostics);
4039

src/Client/Clients/TextDocumentClient.Hover.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
using OmniSharp.Extensions.LanguageServer.Models;
21
using System;
3-
using System.IO;
42
using System.Threading;
53
using System.Threading.Tasks;
6-
using OmniSharp.Extensions.LanguageServerProtocol.Client.Utilities;
4+
using OmniSharp.Extensions.LanguageServer.Client.Utilities;
5+
using OmniSharp.Extensions.LanguageServer.Protocol;
6+
using OmniSharp.Extensions.LanguageServer.Protocol.Models;
77

8-
namespace OmniSharp.Extensions.LanguageServerProtocol.Client.Clients
8+
namespace OmniSharp.Extensions.LanguageServer.Client.Clients
99
{
1010
/// <summary>
1111
/// Client for the LSP Text Document API.
@@ -32,7 +32,7 @@ public partial class TextDocumentClient
3232
/// </returns>
3333
public Task<Hover> Hover(string filePath, int line, int column, CancellationToken cancellationToken = default(CancellationToken))
3434
{
35-
if (String.IsNullOrWhiteSpace(filePath))
35+
if (string.IsNullOrWhiteSpace(filePath))
3636
throw new ArgumentException("Argument cannot be null, empty, or entirely composed of whitespace: 'filePath'.", nameof(filePath));
3737

3838
Uri documentUri = DocumentUri.FromFileSystemPath(filePath);
@@ -60,7 +60,7 @@ public partial class TextDocumentClient
6060
/// </returns>
6161
public Task<Hover> Hover(Uri documentUri, int line, int column, CancellationToken cancellationToken = default(CancellationToken))
6262
{
63-
return PositionalRequest<Hover>("textDocument/hover", documentUri, line, column, cancellationToken);
63+
return PositionalRequest<Hover>(DocumentNames.Hover, documentUri, line, column, cancellationToken);
6464
}
6565
}
6666
}

src/Client/Clients/TextDocumentClient.Sync.cs

+14-15
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
using OmniSharp.Extensions.LanguageServer.Models;
2-
using OmniSharp.Extensions.LanguageServerProtocol.Client.Utilities;
31
using System;
42
using System.IO;
5-
using System.Threading;
6-
using System.Threading.Tasks;
3+
using OmniSharp.Extensions.LanguageServer.Client.Utilities;
4+
using OmniSharp.Extensions.LanguageServer.Protocol;
5+
using OmniSharp.Extensions.LanguageServer.Protocol.Models;
76

8-
namespace OmniSharp.Extensions.LanguageServerProtocol.Client.Clients
7+
namespace OmniSharp.Extensions.LanguageServer.Client.Clients
98
{
109
/// <summary>
1110
/// Client for the LSP Text Document API.
@@ -29,7 +28,7 @@ public partial class TextDocumentClient
2928
/// </remarks>
3029
public void DidOpen(string filePath, string languageId, int version = 0)
3130
{
32-
if (String.IsNullOrWhiteSpace(filePath))
31+
if (string.IsNullOrWhiteSpace(filePath))
3332
throw new ArgumentException($"Argument cannot be null, empty, or entirely composed of whitespace: {nameof(filePath)}.", nameof(filePath));
3433

3534
string text = null;
@@ -61,7 +60,7 @@ public void DidOpen(string filePath, string languageId, int version = 0)
6160
/// </param>
6261
public void DidOpen(string filePath, string languageId, string text, int version = 0)
6362
{
64-
if (String.IsNullOrWhiteSpace(filePath))
63+
if (string.IsNullOrWhiteSpace(filePath))
6564
throw new ArgumentException($"Argument cannot be null, empty, or entirely composed of whitespace: {nameof(filePath)}.", nameof(filePath));
6665

6766
Uri documentUri = DocumentUri.FromFileSystemPath(filePath);
@@ -89,7 +88,7 @@ public void DidOpen(Uri documentUri, string languageId, string text, int version
8988
if (documentUri == null)
9089
throw new ArgumentNullException(nameof(documentUri));
9190

92-
Client.SendNotification("textDocument/didOpen", new DidOpenTextDocumentParams
91+
Client.SendNotification(DocumentNames.DidOpen, new DidOpenTextDocumentParams
9392
{
9493
TextDocument = new TextDocumentItem
9594
{
@@ -120,7 +119,7 @@ public void DidOpen(Uri documentUri, string languageId, string text, int version
120119
/// </remarks>
121120
public void DidChange(string filePath, string languageId, int version = 0)
122121
{
123-
if (String.IsNullOrWhiteSpace(filePath))
122+
if (string.IsNullOrWhiteSpace(filePath))
124123
throw new ArgumentException($"Argument cannot be null, empty, or entirely composed of whitespace: {nameof(filePath)}.", nameof(filePath));
125124

126125
string text = null;
@@ -155,7 +154,7 @@ public void DidChange(string filePath, string languageId, int version = 0)
155154
/// </remarks>
156155
public void DidChange(string filePath, string languageId, string text, int version = 0)
157156
{
158-
if (String.IsNullOrWhiteSpace(filePath))
157+
if (string.IsNullOrWhiteSpace(filePath))
159158
throw new ArgumentException($"Argument cannot be null, empty, or entirely composed of whitespace: {nameof(filePath)}.", nameof(filePath));
160159

161160
Uri documentUri = DocumentUri.FromFileSystemPath(filePath);
@@ -186,7 +185,7 @@ public void DidChange(Uri documentUri, string languageId, string text, int versi
186185
if (documentUri == null)
187186
throw new ArgumentNullException(nameof(documentUri));
188187

189-
Client.SendNotification("textDocument/didChange", new DidChangeTextDocumentParams
188+
Client.SendNotification(DocumentNames.DidChange, new DidChangeTextDocumentParams
190189
{
191190
TextDocument = new VersionedTextDocumentIdentifier
192191
{
@@ -211,7 +210,7 @@ public void DidChange(Uri documentUri, string languageId, string text, int versi
211210
/// </param>
212211
public void DidClose(string filePath)
213212
{
214-
if (String.IsNullOrWhiteSpace(filePath))
213+
if (string.IsNullOrWhiteSpace(filePath))
215214
throw new ArgumentException($"Argument cannot be null, empty, or entirely composed of whitespace: {nameof(filePath)}.", nameof(filePath));
216215

217216
DidClose(
@@ -230,7 +229,7 @@ public void DidClose(Uri documentUri)
230229
if (documentUri == null)
231230
throw new ArgumentNullException(nameof(documentUri));
232231

233-
Client.SendNotification("textDocument/didClose", new DidCloseTextDocumentParams
232+
Client.SendNotification(DocumentNames.DidClose, new DidCloseTextDocumentParams
234233
{
235234
TextDocument = new TextDocumentItem
236235
{
@@ -247,7 +246,7 @@ public void DidClose(Uri documentUri)
247246
/// </param>
248247
public void DidSave(string filePath)
249248
{
250-
if (String.IsNullOrWhiteSpace(filePath))
249+
if (string.IsNullOrWhiteSpace(filePath))
251250
throw new ArgumentException($"Argument cannot be null, empty, or entirely composed of whitespace: {nameof(filePath)}.", nameof(filePath));
252251

253252
DidSave(
@@ -266,7 +265,7 @@ public void DidSave(Uri documentUri)
266265
if (documentUri == null)
267266
throw new ArgumentNullException(nameof(documentUri));
268267

269-
Client.SendNotification("textDocument/didSave", new DidSaveTextDocumentParams
268+
Client.SendNotification(DocumentNames.DidSave, new DidSaveTextDocumentParams
270269
{
271270
TextDocument = new TextDocumentItem
272271
{

src/Client/Clients/TextDocumentClient.cs

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
using OmniSharp.Extensions.LanguageServer.Models;
2-
using OmniSharp.Extensions.LanguageServerProtocol.Client.Utilities;
31
using System;
4-
using System.IO;
52
using System.Threading;
63
using System.Threading.Tasks;
4+
using OmniSharp.Extensions.LanguageServer.Protocol.Models;
75

8-
namespace OmniSharp.Extensions.LanguageServerProtocol.Client.Clients
6+
namespace OmniSharp.Extensions.LanguageServer.Client.Clients
97
{
108
/// <summary>
119
/// Client for the LSP Text Document API.
@@ -57,7 +55,7 @@ public TextDocumentClient(LanguageClient client)
5755
/// </returns>
5856
async Task<TResponse> PositionalRequest<TResponse>(string method, Uri documentUri, int line, int column, CancellationToken cancellationToken)
5957
{
60-
if (String.IsNullOrWhiteSpace(method))
58+
if (string.IsNullOrWhiteSpace(method))
6159
throw new ArgumentException($"Argument cannot be null, empty, or entirely composed of whitespace: {nameof(method)}.", nameof(method));
6260

6361
if (documentUri == null)

0 commit comments

Comments
 (0)