Skip to content

Upgrade language server protocol to v3.2.0 #445

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 54 commits into from
May 2, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
3069b08
Add TextDocumentItem type for didOpen notification
Apr 20, 2017
f56770b
Use TextDocumentItem type for didOpen notification
Apr 20, 2017
eb8f446
Add debugger display attribute to TextDocumentItem class
Apr 22, 2017
f7e05e3
Add VersionedTextDocumentIdentifier type
Apr 22, 2017
3bf58da
Update DidSaveTextDocumentParams type
Apr 22, 2017
a4c4bb1
Update DidChangeTextDocumentParams type
Apr 22, 2017
43aeebb
Update CompletionItem type
Apr 22, 2017
2cf5c18
Add TextDocumentPositionParams type
Apr 24, 2017
4592484
Use TextDocumentPositionParams for signature help
Apr 24, 2017
c9256a8
Update document highlight request
Apr 24, 2017
b25265b
Update hover request
Apr 25, 2017
d8db238
Add DocumentSymbolParams type
Apr 25, 2017
2d69674
Update DocumentSymbolRequest
Apr 25, 2017
7188025
Add CodeActionParams for CodeActionRequest
Apr 25, 2017
da4b573
Update DidOpenTextDocumentNotification
Apr 25, 2017
5eaa247
Update DidCloseTextDocumentNotification
Apr 25, 2017
e354494
Add AbstractMessageType base class for request types
Apr 26, 2017
9de82e3
Add RequestType0 type and update related code
Apr 26, 2017
26db605
Parameterize calls to sendrequest
Apr 26, 2017
a2e9f90
Separate test task in build script into separate components
Apr 26, 2017
424e23c
Remove while loop used for reading error stream
Apr 26, 2017
29df262
Remove trailing whitespace
Apr 26, 2017
96191a9
Update RequestType parametrization
Apr 27, 2017
8082811
Add missing RequestType0 file
Apr 27, 2017
563fce0
Change RequestType.MethodName to RequestType.Method
Apr 27, 2017
8868d55
Derive RequestType from AbstractMessageType
Apr 27, 2017
c9ddc48
Change EventType to NotificationType
Apr 27, 2017
f94b3ed
Change NotificationType.MethodName to NotificationType.Method
Apr 27, 2017
4c68d90
Derive NotificationType from AbstractMessageType
Apr 27, 2017
8324d43
Update NotificationType template parameters
Apr 27, 2017
663ee2c
Change TRegistrationOption to TRegistrationOptions
Apr 27, 2017
86afcec
Fix completion request parameters
Apr 27, 2017
206da14
Add WorkspaceClientCapabilities type
Apr 27, 2017
60f1aa1
Add DynamicRegistrationCapability type
Apr 27, 2017
cd51762
Update WorkspaceClientCapabilities type
Apr 27, 2017
7919ed8
Add TextDocumentClientCapabilities type
Apr 27, 2017
1fb9ccf
Update ClientCapabilities type
Apr 27, 2017
aa8db9a
Add InitializeParams type
Apr 27, 2017
c558ae2
Update ServerCapabilities type
Apr 27, 2017
cc6921d
Fix ClientCapabilities and related types
Apr 27, 2017
fcfefe8
Update initialize request
Apr 27, 2017
61c2e0d
Add registration options for didOpen notification
Apr 29, 2017
e372ac0
Add registration options for didClose notification
Apr 29, 2017
b329d0e
Add registration options for didSave notification
Apr 29, 2017
6640f13
Add registration options for didChange notification
Apr 29, 2017
9345b61
Add registration options for definition request
Apr 29, 2017
2677607
Add registration options for reference request
Apr 29, 2017
339014a
Add registration options for completion request
Apr 29, 2017
0402de1
Add registration options for signaturehelp request
Apr 29, 2017
ed99122
Add registration options for documentHighlight request
Apr 29, 2017
1f41fbc
Add registration options for hover request
Apr 29, 2017
4e3c159
Add registration options for documentSymbol request
Apr 29, 2017
1439bc4
Add registration options for codeAction request
Apr 29, 2017
2f61e26
Capitalize property names and other minor changes
Apr 29, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions PowerShellEditorServices.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if ($PSVersionTable.PSEdition -ne "Core") {
Add-Type -Assembly System.IO.Compression.FileSystem
}

task SetupDotNet -Before Restore, Clean, Build, Test, TestPowerShellApi, PackageNuGet {
task SetupDotNet -Before Restore, Clean, Build, TestHost, TestServer, TestProtocol, TestPowerShellApi, PackageNuGet {

$requiredSdkVersion = "1.0.0"

Expand Down Expand Up @@ -157,9 +157,17 @@ function UploadTestLogs {
}
}

task Test -If { !$script:IsUnix } {
task Test TestServer,TestProtocol,TestHost

task TestServer -If { !$script:IsUnix } {
exec { & $script:dotnetExe test -c $Configuration -f net452 .\test\PowerShellEditorServices.Test\PowerShellEditorServices.Test.csproj }
}

task TestProtocol -If { !$script:IsUnix} {
exec { & $script:dotnetExe test -c $Configuration -f net452 .\test\PowerShellEditorServices.Test.Protocol\PowerShellEditorServices.Test.Protocol.csproj }
}

task TestHost -If { !$script:IsUnix} {
exec { & $script:dotnetExe test -c $Configuration -f net452 .\test\PowerShellEditorServices.Test.Host\PowerShellEditorServices.Test.Host.csproj }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ protected override Task OnStart()
protected override async Task OnStop()
{
// First, notify the language server that we're stopping
var response = await this.SendRequest(ShutdownRequest.Type, new object());
var response = await this.SendRequest<object, object, object>(ShutdownRequest.Type);
await this.SendEvent(ExitNotification.Type, new object());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.Client
{
public class LanguageServiceClient : LanguageClientBase
{
private Dictionary<string, ScriptFileMarker[]> cachedDiagnostics =
private Dictionary<string, ScriptFileMarker[]> cachedDiagnostics =
new Dictionary<string, ScriptFileMarker[]>();

public LanguageServiceClient(ChannelBase clientChannel)
Expand All @@ -34,15 +34,15 @@ protected override Task Initialize()
protected override Task OnConnect()
{
// Send the 'initialize' request and wait for the response
var initializeRequest = new InitializeRequest
var initializeParams = new InitializeParams
{
RootPath = "",
Capabilities = new ClientCapabilities()
};

return this.SendRequest(
InitializeRequest.Type,
initializeRequest);
InitializeRequest.Type,
initializeParams);
}

#region Events
Expand All @@ -62,7 +62,7 @@ protected void OnDiagnosticsReceived(string filePath)
#region Private Methods

private Task HandlePublishDiagnosticsEvent(
PublishDiagnosticsNotification diagnostics,
PublishDiagnosticsNotification diagnostics,
EventContext eventContext)
{
string normalizedPath = diagnostics.Uri.ToLower();
Expand All @@ -79,7 +79,7 @@ private Task HandlePublishDiagnosticsEvent(

private static ScriptFileMarker GetMarkerFromDiagnostic(Diagnostic diagnostic)
{
DiagnosticSeverity severity =
DiagnosticSeverity severity =
diagnostic.Severity.GetValueOrDefault(
DiagnosticSeverity.Error);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
public class AttachRequest
{
public static readonly
RequestType<AttachRequestArguments, object> Type =
RequestType<AttachRequestArguments, object>.Create("attach");
RequestType<AttachRequestArguments, object, object, object> Type =
RequestType<AttachRequestArguments, object, object, object>.Create("attach");
}

public class AttachRequestArguments
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
public class ConfigurationDoneRequest
{
public static readonly
RequestType<object, object> Type =
RequestType<object, object>.Create("configurationDone");
RequestType<object, object, object, object> Type =
RequestType<object, object, object, object>.Create("configurationDone");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
public class ContinueRequest
{
public static readonly
RequestType<object, object> Type =
RequestType<object, object>.Create("continue");
RequestType<object, object, object, object> Type =
RequestType<object, object, object, object>.Create("continue");
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//

using System;
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;

namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
{
public class ContinuedEvent
{
public static readonly
EventType<ContinuedEvent> Type =
EventType<ContinuedEvent>.Create("continued");
NotificationType<ContinuedEvent, object> Type =
NotificationType<ContinuedEvent, object>.Create("continued");

public int ThreadId { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
{
public class DisconnectRequest
public class DisconnectRequest
{
public static readonly
RequestType<object, object> Type =
RequestType<object, object>.Create("disconnect");
RequestType<object, object, object, object> Type =
RequestType<object, object, object, object>.Create("disconnect");
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
public class EvaluateRequest
{
public static readonly
RequestType<EvaluateRequestArguments, EvaluateResponseBody> Type =
RequestType<EvaluateRequestArguments, EvaluateResponseBody>.Create("evaluate");
RequestType<EvaluateRequestArguments, EvaluateResponseBody, object, object> Type =
RequestType<EvaluateRequestArguments, EvaluateResponseBody, object, object>.Create("evaluate");
}

public class EvaluateRequestArguments
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
public class ExitedEvent
{
public static readonly
EventType<ExitedEventBody> Type =
EventType<ExitedEventBody>.Create("exited");
NotificationType<ExitedEventBody, object> Type =
NotificationType<ExitedEventBody, object>.Create("exited");
}

public class ExitedEventBody
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
public class InitializeRequest
{
public static readonly
RequestType<InitializeRequestArguments, InitializeResponseBody> Type =
RequestType<InitializeRequestArguments, InitializeResponseBody>.Create("initialize");
RequestType<InitializeRequestArguments, InitializeResponseBody, object, object> Type =
RequestType<InitializeRequestArguments, InitializeResponseBody, object, object>.Create("initialize");
}

public class InitializeRequestArguments
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
public class InitializedEvent
{
public static readonly
EventType<object> Type =
EventType<object>.Create("initialized");
NotificationType<object, object> Type =
NotificationType<object, object>.Create("initialized");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
public class LaunchRequest
{
public static readonly
RequestType<LaunchRequestArguments, object> Type =
RequestType<LaunchRequestArguments, object>.Create("launch");
RequestType<LaunchRequestArguments, object, object, object> Type =
RequestType<LaunchRequestArguments, object, object, object>.Create("launch");
}

public class LaunchRequestArguments
Expand All @@ -36,7 +36,7 @@ public class LaunchRequestArguments
public bool NoDebug { get; set; }

/// <summary>
/// Gets or sets a boolean value that determines whether to automatically stop
/// Gets or sets a boolean value that determines whether to automatically stop
/// target after launch. If not specified, target does not stop.
/// </summary>
public bool StopOnEntry { get; set; }
Expand All @@ -53,7 +53,7 @@ public class LaunchRequestArguments
public string Cwd { get; set; }

/// <summary>
/// Gets or sets the absolute path to the runtime executable to be used.
/// Gets or sets the absolute path to the runtime executable to be used.
/// Default is the runtime executable on the PATH.
/// </summary>
public string RuntimeExecutable { get; set; }
Expand All @@ -64,7 +64,7 @@ public class LaunchRequestArguments
public string[] RuntimeArgs { get; set; }

/// <summary>
/// Gets or sets optional environment variables to pass to the debuggee. The string valued
/// Gets or sets optional environment variables to pass to the debuggee. The string valued
/// properties of the 'environmentVariables' are used as key/value pairs.
/// </summary>
public Dictionary<string, string> Env { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
public class NextRequest
{
public static readonly
RequestType<object, object> Type =
RequestType<object, object>.Create("next");
RequestType<object, object, object, object> Type =
RequestType<object, object, object, object>.Create("next");
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
public class OutputEvent
{
public static readonly
EventType<OutputEventBody> Type =
EventType<OutputEventBody>.Create("output");
NotificationType<OutputEventBody, object> Type =
NotificationType<OutputEventBody, object>.Create("output");
}

public class OutputEventBody
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
public class PauseRequest
{
public static readonly
RequestType<object, object> Type =
RequestType<object, object>.Create("pause");
RequestType<object, object, object, object> Type =
RequestType<object, object, object, object>.Create("pause");
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
public class ScopesRequest
{
public static readonly
RequestType<ScopesRequestArguments, ScopesResponseBody> Type =
RequestType<ScopesRequestArguments, ScopesResponseBody>.Create("scopes");
RequestType<ScopesRequestArguments, ScopesResponseBody, object, object> Type =
RequestType<ScopesRequestArguments, ScopesResponseBody, object, object>.Create("scopes");
}

[DebuggerDisplay("FrameId = {FrameId}")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
public class SetBreakpointsRequest
{
public static readonly
RequestType<SetBreakpointsRequestArguments, SetBreakpointsResponseBody> Type =
RequestType<SetBreakpointsRequestArguments, SetBreakpointsResponseBody>.Create("setBreakpoints");
RequestType<SetBreakpointsRequestArguments, SetBreakpointsResponseBody, object, object> Type =
RequestType<SetBreakpointsRequestArguments, SetBreakpointsResponseBody, object, object>.Create("setBreakpoints");
}

public class SetBreakpointsRequestArguments
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
public class SetExceptionBreakpointsRequest
{
public static readonly
RequestType<SetExceptionBreakpointsRequestArguments, object> Type =
RequestType<SetExceptionBreakpointsRequestArguments, object>.Create("setExceptionBreakpoints");
RequestType<SetExceptionBreakpointsRequestArguments, object, object, object> Type =
RequestType<SetExceptionBreakpointsRequestArguments, object, object, object>.Create("setExceptionBreakpoints");
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
public class SetFunctionBreakpointsRequest
{
public static readonly
RequestType<SetFunctionBreakpointsRequestArguments, SetBreakpointsResponseBody> Type =
RequestType<SetFunctionBreakpointsRequestArguments, SetBreakpointsResponseBody>.Create("setFunctionBreakpoints");
RequestType<SetFunctionBreakpointsRequestArguments, SetBreakpointsResponseBody, object, object> Type =
RequestType<SetFunctionBreakpointsRequestArguments, SetBreakpointsResponseBody, object, object>.Create("setFunctionBreakpoints");
}

public class SetFunctionBreakpointsRequestArguments
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
public class SetVariableRequest
{
public static readonly
RequestType<SetVariableRequestArguments, SetVariableResponseBody> Type =
RequestType<SetVariableRequestArguments, SetVariableResponseBody>.Create("setVariable");
RequestType<SetVariableRequestArguments, SetVariableResponseBody, object, object> Type =
RequestType<SetVariableRequestArguments, SetVariableResponseBody, object, object>.Create("setVariable");
}

[DebuggerDisplay("VariablesReference = {VariablesReference}")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
public class SourceRequest
{
public static readonly
RequestType<SourceRequestArguments, SourceResponseBody> Type =
RequestType<SourceRequestArguments, SourceResponseBody>.Create("source");
RequestType<SourceRequestArguments, SourceResponseBody, object, object> Type =
RequestType<SourceRequestArguments, SourceResponseBody, object, object>.Create("source");
}

public class SourceRequestArguments
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
public class StackTraceRequest
{
public static readonly
RequestType<StackTraceRequestArguments, StackTraceResponseBody> Type =
RequestType<StackTraceRequestArguments, StackTraceResponseBody>.Create("stackTrace");
RequestType<StackTraceRequestArguments, StackTraceResponseBody, object, object> Type =
RequestType<StackTraceRequestArguments, StackTraceResponseBody, object, object>.Create("stackTrace");
}

[DebuggerDisplay("ThreadId = {ThreadId}, Levels = {Levels}")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
public class StartedEvent
{
public static readonly
EventType<object> Type =
EventType<object>.Create("started");
NotificationType<object, object> Type =
NotificationType<object, object>.Create("started");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
public class StepInRequest
{
public static readonly
RequestType<object, object> Type =
RequestType<object, object>.Create("stepIn");
RequestType<object, object, object, object> Type =
RequestType<object, object, object, object>.Create("stepIn");
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
public class StepOutRequest
{
public static readonly
RequestType<object, object> Type =
RequestType<object, object>.Create("stepOut");
RequestType<object, object, object, object> Type =
RequestType<object, object, object, object>.Create("stepOut");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
public class StoppedEvent
{
public static readonly
EventType<StoppedEventBody> Type =
EventType<StoppedEventBody>.Create("stopped");
NotificationType<StoppedEventBody, object> Type =
NotificationType<StoppedEventBody, object>.Create("stopped");
}

public class StoppedEventBody
Expand All @@ -26,7 +26,7 @@ public class StoppedEventBody
/// </summary>
public int? ThreadId { get; set; }

public Source Source { get; set; }
public Source Source { get; set; }

/// <summary>
/// Gets or sets additional information such as an error message.
Expand Down
Loading