diff --git a/LSP.sln b/LSP.sln
index 085107475..b22028854 100644
--- a/LSP.sln
+++ b/LSP.sln
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
-VisualStudioVersion = 15.0.26730.16
+VisualStudioVersion = 15.0.27004.2009
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{D764E024-3D3F-4112-B932-2DB722A1BACC}"
EndProject
@@ -21,8 +21,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".config", ".config", "{AE4D
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JsonRpc", "src\JsonRpc\JsonRpc.csproj", "{9AF43FA2-EF35-435E-B59E-724877E44DDA}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lsp", "src\Lsp\Lsp.csproj", "{50EA648A-67D3-4127-9517-EC7C1426E2E7}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JsonRpc.Tests", "test\JsonRpc.Tests\JsonRpc.Tests.csproj", "{35F9B883-36D0-4F3B-A191-9BBD05B798A7}"
EndProject
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
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Client.Tests", "test\Client.Tests\Client.Tests.csproj", "{97437BE1-2EC3-4F6B-AC75-C3E099040A07}"
EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Protocol", "src\Protocol\Protocol.csproj", "{92B331E9-5225-428D-AE82-37F5F46156A3}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Server", "src\Server\Server.csproj", "{E540868F-438E-4F7F-BBB7-010D6CB18A57}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -57,18 +59,6 @@ Global
{9AF43FA2-EF35-435E-B59E-724877E44DDA}.Release|x64.Build.0 = Release|Any CPU
{9AF43FA2-EF35-435E-B59E-724877E44DDA}.Release|x86.ActiveCfg = Release|Any CPU
{9AF43FA2-EF35-435E-B59E-724877E44DDA}.Release|x86.Build.0 = Release|Any CPU
- {50EA648A-67D3-4127-9517-EC7C1426E2E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {50EA648A-67D3-4127-9517-EC7C1426E2E7}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {50EA648A-67D3-4127-9517-EC7C1426E2E7}.Debug|x64.ActiveCfg = Debug|Any CPU
- {50EA648A-67D3-4127-9517-EC7C1426E2E7}.Debug|x64.Build.0 = Debug|Any CPU
- {50EA648A-67D3-4127-9517-EC7C1426E2E7}.Debug|x86.ActiveCfg = Debug|Any CPU
- {50EA648A-67D3-4127-9517-EC7C1426E2E7}.Debug|x86.Build.0 = Debug|Any CPU
- {50EA648A-67D3-4127-9517-EC7C1426E2E7}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {50EA648A-67D3-4127-9517-EC7C1426E2E7}.Release|Any CPU.Build.0 = Release|Any CPU
- {50EA648A-67D3-4127-9517-EC7C1426E2E7}.Release|x64.ActiveCfg = Release|Any CPU
- {50EA648A-67D3-4127-9517-EC7C1426E2E7}.Release|x64.Build.0 = Release|Any CPU
- {50EA648A-67D3-4127-9517-EC7C1426E2E7}.Release|x86.ActiveCfg = Release|Any CPU
- {50EA648A-67D3-4127-9517-EC7C1426E2E7}.Release|x86.Build.0 = Release|Any CPU
{35F9B883-36D0-4F3B-A191-9BBD05B798A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{35F9B883-36D0-4F3B-A191-9BBD05B798A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{35F9B883-36D0-4F3B-A191-9BBD05B798A7}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -129,18 +119,43 @@ Global
{97437BE1-2EC3-4F6B-AC75-C3E099040A07}.Release|x64.Build.0 = Release|Any CPU
{97437BE1-2EC3-4F6B-AC75-C3E099040A07}.Release|x86.ActiveCfg = Release|Any CPU
{97437BE1-2EC3-4F6B-AC75-C3E099040A07}.Release|x86.Build.0 = Release|Any CPU
+ {92B331E9-5225-428D-AE82-37F5F46156A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {92B331E9-5225-428D-AE82-37F5F46156A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {92B331E9-5225-428D-AE82-37F5F46156A3}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {92B331E9-5225-428D-AE82-37F5F46156A3}.Debug|x64.Build.0 = Debug|Any CPU
+ {92B331E9-5225-428D-AE82-37F5F46156A3}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {92B331E9-5225-428D-AE82-37F5F46156A3}.Debug|x86.Build.0 = Debug|Any CPU
+ {92B331E9-5225-428D-AE82-37F5F46156A3}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {92B331E9-5225-428D-AE82-37F5F46156A3}.Release|Any CPU.Build.0 = Release|Any CPU
+ {92B331E9-5225-428D-AE82-37F5F46156A3}.Release|x64.ActiveCfg = Release|Any CPU
+ {92B331E9-5225-428D-AE82-37F5F46156A3}.Release|x64.Build.0 = Release|Any CPU
+ {92B331E9-5225-428D-AE82-37F5F46156A3}.Release|x86.ActiveCfg = Release|Any CPU
+ {92B331E9-5225-428D-AE82-37F5F46156A3}.Release|x86.Build.0 = Release|Any CPU
+ {E540868F-438E-4F7F-BBB7-010D6CB18A57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {E540868F-438E-4F7F-BBB7-010D6CB18A57}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {E540868F-438E-4F7F-BBB7-010D6CB18A57}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {E540868F-438E-4F7F-BBB7-010D6CB18A57}.Debug|x64.Build.0 = Debug|Any CPU
+ {E540868F-438E-4F7F-BBB7-010D6CB18A57}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {E540868F-438E-4F7F-BBB7-010D6CB18A57}.Debug|x86.Build.0 = Debug|Any CPU
+ {E540868F-438E-4F7F-BBB7-010D6CB18A57}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {E540868F-438E-4F7F-BBB7-010D6CB18A57}.Release|Any CPU.Build.0 = Release|Any CPU
+ {E540868F-438E-4F7F-BBB7-010D6CB18A57}.Release|x64.ActiveCfg = Release|Any CPU
+ {E540868F-438E-4F7F-BBB7-010D6CB18A57}.Release|x64.Build.0 = Release|Any CPU
+ {E540868F-438E-4F7F-BBB7-010D6CB18A57}.Release|x86.ActiveCfg = Release|Any CPU
+ {E540868F-438E-4F7F-BBB7-010D6CB18A57}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{9AF43FA2-EF35-435E-B59E-724877E44DDA} = {D764E024-3D3F-4112-B932-2DB722A1BACC}
- {50EA648A-67D3-4127-9517-EC7C1426E2E7} = {D764E024-3D3F-4112-B932-2DB722A1BACC}
{35F9B883-36D0-4F3B-A191-9BBD05B798A7} = {2F323ED5-EBF8-45E1-B9D3-C014561B3DDA}
{482B180B-FD5C-4705-BBE1-094C905F1E1F} = {2F323ED5-EBF8-45E1-B9D3-C014561B3DDA}
{F2067F5F-FA4E-4990-B301-E7898FC4C45F} = {A316FCEC-81AD-45FB-93EE-C62CA09300DC}
{417E95B2-5AB9-49D5-B7CD-12255472E2E7} = {D764E024-3D3F-4112-B932-2DB722A1BACC}
{97437BE1-2EC3-4F6B-AC75-C3E099040A07} = {2F323ED5-EBF8-45E1-B9D3-C014561B3DDA}
+ {92B331E9-5225-428D-AE82-37F5F46156A3} = {D764E024-3D3F-4112-B932-2DB722A1BACC}
+ {E540868F-438E-4F7F-BBB7-010D6CB18A57} = {D764E024-3D3F-4112-B932-2DB722A1BACC}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D38DD0EC-D095-4BCD-B8AF-2D788AF3B9AE}
diff --git a/sample/SampleServer/Program.cs b/sample/SampleServer/Program.cs
index d9839c1d9..583e8af35 100644
--- a/sample/SampleServer/Program.cs
+++ b/sample/SampleServer/Program.cs
@@ -3,6 +3,7 @@
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using OmniSharp.Extensions.LanguageServer;
+using OmniSharp.Extensions.LanguageServer.Server;
namespace SampleServer
{
diff --git a/sample/SampleServer/SampleServer.csproj b/sample/SampleServer/SampleServer.csproj
index da7a95171..829fbb6f8 100644
--- a/sample/SampleServer/SampleServer.csproj
+++ b/sample/SampleServer/SampleServer.csproj
@@ -7,7 +7,7 @@
-
+
diff --git a/sample/SampleServer/TextDocumentHandler.cs b/sample/SampleServer/TextDocumentHandler.cs
index b85a7d9fc..233aff09f 100644
--- a/sample/SampleServer/TextDocumentHandler.cs
+++ b/sample/SampleServer/TextDocumentHandler.cs
@@ -1,12 +1,11 @@
using System;
using System.Threading.Tasks;
using OmniSharp.Extensions.LanguageServer;
-using OmniSharp.Extensions.LanguageServer.Abstractions;
-using OmniSharp.Extensions.LanguageServer.Capabilities.Client;
-using OmniSharp.Extensions.LanguageServer.Capabilities.Server;
-using OmniSharp.Extensions.LanguageServer.Models;
using OmniSharp.Extensions.LanguageServer.Protocol;
-using OmniSharp.Extensions.LanguageServer.Protocol.Document;
+using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities;
+using OmniSharp.Extensions.LanguageServer.Protocol.Models;
+using OmniSharp.Extensions.LanguageServer.Protocol.Server.Capabilities;
+using OmniSharp.Extensions.LanguageServer.Server;
namespace SampleServer
{
@@ -105,4 +104,4 @@ public TextDocumentAttributes GetTextDocumentAttributes(Uri uri)
return new TextDocumentAttributes(uri, "csharp");
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Client/Client.csproj b/src/Client/Client.csproj
index a64afa939..c0d87044b 100644
--- a/src/Client/Client.csproj
+++ b/src/Client/Client.csproj
@@ -4,7 +4,7 @@
netstandard2.0
AnyCPU
OmniSharp.Extensions.LanguageClient
- OmniSharp.Extensions.LanguageServerProtocol.Client
+ OmniSharp.Extensions.LanguageServer.Client
@@ -16,6 +16,6 @@
-
+
diff --git a/src/Client/Clients/TextDocumentClient.Completions.cs b/src/Client/Clients/TextDocumentClient.Completions.cs
index fd54700ed..8a85496cb 100644
--- a/src/Client/Clients/TextDocumentClient.Completions.cs
+++ b/src/Client/Clients/TextDocumentClient.Completions.cs
@@ -1,10 +1,11 @@
-using OmniSharp.Extensions.LanguageServer.Models;
-using OmniSharp.Extensions.LanguageServerProtocol.Client.Utilities;
using System;
using System.Threading;
using System.Threading.Tasks;
+using OmniSharp.Extensions.LanguageServer.Client.Utilities;
+using OmniSharp.Extensions.LanguageServer.Protocol;
+using OmniSharp.Extensions.LanguageServer.Protocol.Models;
-namespace OmniSharp.Extensions.LanguageServerProtocol.Client.Clients
+namespace OmniSharp.Extensions.LanguageServer.Client.Clients
{
///
/// Client for the LSP Text Document API.
@@ -31,7 +32,7 @@ public partial class TextDocumentClient
///
public Task Completions(string filePath, int line, int column, CancellationToken cancellationToken = default(CancellationToken))
{
- if (String.IsNullOrWhiteSpace(filePath))
+ if (string.IsNullOrWhiteSpace(filePath))
throw new ArgumentException($"Argument cannot be null, empty, or entirely composed of whitespace: {nameof(filePath)}.", nameof(filePath));
Uri documentUri = DocumentUri.FromFileSystemPath(filePath);
@@ -59,7 +60,7 @@ public partial class TextDocumentClient
///
public Task Completions(Uri documentUri, int line, int column, CancellationToken cancellationToken = default(CancellationToken))
{
- return PositionalRequest("textDocument/completion", documentUri, line, column, cancellationToken);
+ return PositionalRequest(DocumentNames.Completion, documentUri, line, column, cancellationToken);
}
}
}
diff --git a/src/Client/Clients/TextDocumentClient.Diagnostics.cs b/src/Client/Clients/TextDocumentClient.Diagnostics.cs
index 4cc773875..afd032e75 100644
--- a/src/Client/Clients/TextDocumentClient.Diagnostics.cs
+++ b/src/Client/Clients/TextDocumentClient.Diagnostics.cs
@@ -1,11 +1,9 @@
-using OmniSharp.Extensions.LanguageServer.Models;
using System;
using System.Collections.Generic;
-using System.IO;
-using System.Threading;
-using System.Threading.Tasks;
+using OmniSharp.Extensions.LanguageServer.Protocol;
+using OmniSharp.Extensions.LanguageServer.Protocol.Models;
-namespace OmniSharp.Extensions.LanguageServerProtocol.Client.Clients
+namespace OmniSharp.Extensions.LanguageServer.Client.Clients
{
///
/// Client for the LSP Text Document API.
@@ -29,12 +27,13 @@ public IDisposable OnPublishDiagnostics(PublishDiagnosticsHandler handler)
if (handler == null)
throw new ArgumentNullException(nameof(handler));
- return Client.HandleNotification("textDocument/publishDiagnostics", notification =>
+ return Client.HandleNotification(DocumentNames.PublishDiagnostics, notification =>
{
+ if (notification.Diagnostics == null)
if (notification.Diagnostics == null)
return; // Invalid notification.
- List diagnostics = new List();
+ var diagnostics = new List();
if (notification.Diagnostics != null)
diagnostics.AddRange(notification.Diagnostics);
diff --git a/src/Client/Clients/TextDocumentClient.Hover.cs b/src/Client/Clients/TextDocumentClient.Hover.cs
index c028bfd65..5f853c6a7 100644
--- a/src/Client/Clients/TextDocumentClient.Hover.cs
+++ b/src/Client/Clients/TextDocumentClient.Hover.cs
@@ -1,11 +1,11 @@
-using OmniSharp.Extensions.LanguageServer.Models;
using System;
-using System.IO;
using System.Threading;
using System.Threading.Tasks;
-using OmniSharp.Extensions.LanguageServerProtocol.Client.Utilities;
+using OmniSharp.Extensions.LanguageServer.Client.Utilities;
+using OmniSharp.Extensions.LanguageServer.Protocol;
+using OmniSharp.Extensions.LanguageServer.Protocol.Models;
-namespace OmniSharp.Extensions.LanguageServerProtocol.Client.Clients
+namespace OmniSharp.Extensions.LanguageServer.Client.Clients
{
///
/// Client for the LSP Text Document API.
@@ -32,7 +32,7 @@ public partial class TextDocumentClient
///
public Task Hover(string filePath, int line, int column, CancellationToken cancellationToken = default(CancellationToken))
{
- if (String.IsNullOrWhiteSpace(filePath))
+ if (string.IsNullOrWhiteSpace(filePath))
throw new ArgumentException("Argument cannot be null, empty, or entirely composed of whitespace: 'filePath'.", nameof(filePath));
Uri documentUri = DocumentUri.FromFileSystemPath(filePath);
@@ -60,7 +60,7 @@ public partial class TextDocumentClient
///
public Task Hover(Uri documentUri, int line, int column, CancellationToken cancellationToken = default(CancellationToken))
{
- return PositionalRequest("textDocument/hover", documentUri, line, column, cancellationToken);
+ return PositionalRequest(DocumentNames.Hover, documentUri, line, column, cancellationToken);
}
}
}
diff --git a/src/Client/Clients/TextDocumentClient.Sync.cs b/src/Client/Clients/TextDocumentClient.Sync.cs
index 0cd9d0454..e41549dfc 100644
--- a/src/Client/Clients/TextDocumentClient.Sync.cs
+++ b/src/Client/Clients/TextDocumentClient.Sync.cs
@@ -1,11 +1,10 @@
-using OmniSharp.Extensions.LanguageServer.Models;
-using OmniSharp.Extensions.LanguageServerProtocol.Client.Utilities;
using System;
using System.IO;
-using System.Threading;
-using System.Threading.Tasks;
+using OmniSharp.Extensions.LanguageServer.Client.Utilities;
+using OmniSharp.Extensions.LanguageServer.Protocol;
+using OmniSharp.Extensions.LanguageServer.Protocol.Models;
-namespace OmniSharp.Extensions.LanguageServerProtocol.Client.Clients
+namespace OmniSharp.Extensions.LanguageServer.Client.Clients
{
///
/// Client for the LSP Text Document API.
@@ -29,7 +28,7 @@ public partial class TextDocumentClient
///
public void DidOpen(string filePath, string languageId, int version = 0)
{
- if (String.IsNullOrWhiteSpace(filePath))
+ if (string.IsNullOrWhiteSpace(filePath))
throw new ArgumentException($"Argument cannot be null, empty, or entirely composed of whitespace: {nameof(filePath)}.", nameof(filePath));
string text = null;
@@ -61,7 +60,7 @@ public void DidOpen(string filePath, string languageId, int version = 0)
///
public void DidOpen(string filePath, string languageId, string text, int version = 0)
{
- if (String.IsNullOrWhiteSpace(filePath))
+ if (string.IsNullOrWhiteSpace(filePath))
throw new ArgumentException($"Argument cannot be null, empty, or entirely composed of whitespace: {nameof(filePath)}.", nameof(filePath));
Uri documentUri = DocumentUri.FromFileSystemPath(filePath);
@@ -89,7 +88,7 @@ public void DidOpen(Uri documentUri, string languageId, string text, int version
if (documentUri == null)
throw new ArgumentNullException(nameof(documentUri));
- Client.SendNotification("textDocument/didOpen", new DidOpenTextDocumentParams
+ Client.SendNotification(DocumentNames.DidOpen, new DidOpenTextDocumentParams
{
TextDocument = new TextDocumentItem
{
@@ -120,7 +119,7 @@ public void DidOpen(Uri documentUri, string languageId, string text, int version
///
public void DidChange(string filePath, string languageId, int version = 0)
{
- if (String.IsNullOrWhiteSpace(filePath))
+ if (string.IsNullOrWhiteSpace(filePath))
throw new ArgumentException($"Argument cannot be null, empty, or entirely composed of whitespace: {nameof(filePath)}.", nameof(filePath));
string text = null;
@@ -155,7 +154,7 @@ public void DidChange(string filePath, string languageId, int version = 0)
///
public void DidChange(string filePath, string languageId, string text, int version = 0)
{
- if (String.IsNullOrWhiteSpace(filePath))
+ if (string.IsNullOrWhiteSpace(filePath))
throw new ArgumentException($"Argument cannot be null, empty, or entirely composed of whitespace: {nameof(filePath)}.", nameof(filePath));
Uri documentUri = DocumentUri.FromFileSystemPath(filePath);
@@ -186,7 +185,7 @@ public void DidChange(Uri documentUri, string languageId, string text, int versi
if (documentUri == null)
throw new ArgumentNullException(nameof(documentUri));
- Client.SendNotification("textDocument/didChange", new DidChangeTextDocumentParams
+ Client.SendNotification(DocumentNames.DidChange, new DidChangeTextDocumentParams
{
TextDocument = new VersionedTextDocumentIdentifier
{
@@ -211,7 +210,7 @@ public void DidChange(Uri documentUri, string languageId, string text, int versi
///
public void DidClose(string filePath)
{
- if (String.IsNullOrWhiteSpace(filePath))
+ if (string.IsNullOrWhiteSpace(filePath))
throw new ArgumentException($"Argument cannot be null, empty, or entirely composed of whitespace: {nameof(filePath)}.", nameof(filePath));
DidClose(
@@ -230,7 +229,7 @@ public void DidClose(Uri documentUri)
if (documentUri == null)
throw new ArgumentNullException(nameof(documentUri));
- Client.SendNotification("textDocument/didClose", new DidCloseTextDocumentParams
+ Client.SendNotification(DocumentNames.DidClose, new DidCloseTextDocumentParams
{
TextDocument = new TextDocumentItem
{
@@ -247,7 +246,7 @@ public void DidClose(Uri documentUri)
///
public void DidSave(string filePath)
{
- if (String.IsNullOrWhiteSpace(filePath))
+ if (string.IsNullOrWhiteSpace(filePath))
throw new ArgumentException($"Argument cannot be null, empty, or entirely composed of whitespace: {nameof(filePath)}.", nameof(filePath));
DidSave(
@@ -266,7 +265,7 @@ public void DidSave(Uri documentUri)
if (documentUri == null)
throw new ArgumentNullException(nameof(documentUri));
- Client.SendNotification("textDocument/didSave", new DidSaveTextDocumentParams
+ Client.SendNotification(DocumentNames.DidSave, new DidSaveTextDocumentParams
{
TextDocument = new TextDocumentItem
{
diff --git a/src/Client/Clients/TextDocumentClient.cs b/src/Client/Clients/TextDocumentClient.cs
index bde0d3107..5fa0676e4 100644
--- a/src/Client/Clients/TextDocumentClient.cs
+++ b/src/Client/Clients/TextDocumentClient.cs
@@ -1,11 +1,9 @@
-using OmniSharp.Extensions.LanguageServer.Models;
-using OmniSharp.Extensions.LanguageServerProtocol.Client.Utilities;
using System;
-using System.IO;
using System.Threading;
using System.Threading.Tasks;
+using OmniSharp.Extensions.LanguageServer.Protocol.Models;
-namespace OmniSharp.Extensions.LanguageServerProtocol.Client.Clients
+namespace OmniSharp.Extensions.LanguageServer.Client.Clients
{
///
/// Client for the LSP Text Document API.
@@ -57,7 +55,7 @@ public TextDocumentClient(LanguageClient client)
///
async Task PositionalRequest(string method, Uri documentUri, int line, int column, CancellationToken cancellationToken)
{
- if (String.IsNullOrWhiteSpace(method))
+ if (string.IsNullOrWhiteSpace(method))
throw new ArgumentException($"Argument cannot be null, empty, or entirely composed of whitespace: {nameof(method)}.", nameof(method));
if (documentUri == null)
diff --git a/src/Client/Clients/WindowClient.cs b/src/Client/Clients/WindowClient.cs
index 77d20120a..a8965e2e6 100644
--- a/src/Client/Clients/WindowClient.cs
+++ b/src/Client/Clients/WindowClient.cs
@@ -1,7 +1,8 @@
-using OmniSharp.Extensions.LanguageServer.Models;
using System;
+using OmniSharp.Extensions.LanguageServer.Protocol;
+using OmniSharp.Extensions.LanguageServer.Protocol.Models;
-namespace OmniSharp.Extensions.LanguageServerProtocol.Client.Clients
+namespace OmniSharp.Extensions.LanguageServer.Client.Clients
{
///
/// Client for the LSP Window API.
@@ -41,7 +42,7 @@ public IDisposable OnLogMessage(LogMessageHandler handler)
if (handler == null)
throw new ArgumentNullException(nameof(handler));
- return Client.HandleNotification("window/logMessage",
+ return Client.HandleNotification(WindowNames.LogMessage,
notification => handler(notification.Message, notification.Type)
);
}
diff --git a/src/Client/Clients/WorkspaceClient.cs b/src/Client/Clients/WorkspaceClient.cs
index c2d21f840..de4f9d625 100644
--- a/src/Client/Clients/WorkspaceClient.cs
+++ b/src/Client/Clients/WorkspaceClient.cs
@@ -1,7 +1,8 @@
-using Newtonsoft.Json.Linq;
-using System;
+using System;
+using Newtonsoft.Json.Linq;
+using OmniSharp.Extensions.LanguageServer.Protocol;
-namespace OmniSharp.Extensions.LanguageServerProtocol.Client.Clients
+namespace OmniSharp.Extensions.LanguageServer.Client.Clients
{
///
/// Client for the LSP Workspace API.
@@ -38,7 +39,7 @@ public void DidChangeConfiguration(JObject configuration)
if (configuration == null)
throw new ArgumentNullException(nameof(configuration));
- Client.SendNotification("workspace/didChangeConfiguration", new JObject(
+ Client.SendNotification(WorkspaceNames.DidChangeConfiguration, new JObject(
new JProperty("settings", configuration)
));
}
diff --git a/src/Client/Dispatcher/LspDispatcher.cs b/src/Client/Dispatcher/LspDispatcher.cs
index 2282b27ad..c4a90fc04 100644
--- a/src/Client/Dispatcher/LspDispatcher.cs
+++ b/src/Client/Dispatcher/LspDispatcher.cs
@@ -1,12 +1,12 @@
-using Newtonsoft.Json.Linq;
-using OmniSharp.Extensions.LanguageServerProtocol.Client.Handlers;
-using System;
+using System;
using System.Collections.Concurrent;
using System.Reactive.Disposables;
using System.Threading;
using System.Threading.Tasks;
+using Newtonsoft.Json.Linq;
+using OmniSharp.Extensions.LanguageServer.Client.Handlers;
-namespace OmniSharp.Extensions.LanguageServerProtocol.Client.Dispatcher
+namespace OmniSharp.Extensions.LanguageServer.Client.Dispatcher
{
///
/// Dispatches requests and notifications from a language server to a language client.
@@ -60,7 +60,7 @@ public IDisposable RegisterHandler(IHandler handler)
///
public async Task TryHandleEmptyNotification(string method)
{
- if (String.IsNullOrWhiteSpace(method))
+ if (string.IsNullOrWhiteSpace(method))
throw new ArgumentException($"Argument cannot be null, empty, or entirely composed of whitespace: {nameof(method)}.", nameof(method));
if (_handlers.TryGetValue(method, out IHandler handler) && handler is IInvokeEmptyNotificationHandler emptyNotificationHandler)
@@ -87,7 +87,7 @@ public async Task TryHandleEmptyNotification(string method)
///
public async Task TryHandleNotification(string method, JObject notification)
{
- if (String.IsNullOrWhiteSpace(method))
+ if (string.IsNullOrWhiteSpace(method))
throw new ArgumentException($"Argument cannot be null, empty, or entirely composed of whitespace: {nameof(method)}.", nameof(method));
if (_handlers.TryGetValue(method, out IHandler handler) && handler is IInvokeNotificationHandler notificationHandler)
@@ -117,7 +117,7 @@ public async Task TryHandleNotification(string method, JObject notificatio
///
public Task