Skip to content

Wired up Show Information|Warning|Error Message #244

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 31 commits into from
Dec 7, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
9b22397
Add support for debug protocol setVariableRequest. (#283)
rkeithhill Aug 31, 2016
dba6515
Merge branch 'master' into develop
daviwil Sep 2, 2016
aff18ec
PSES half of program -> script launch prop change.
rkeithhill Oct 23, 2016
0c2b8d3
Merge pull request #297 from rkeithhill/rkeithhill/change-launch-json…
daviwil Oct 24, 2016
f56a683
Initial work to support breakpoint hit count.
rkeithhill Nov 3, 2016
4123b7e
Add support for handling just HitCount and Condition + HitCount.
rkeithhill Nov 5, 2016
39507c9
Add PSMisleadingBacktick rule to the default ruleset.
rkeithhill Nov 5, 2016
73c6110
Merge pull request #301 from rkeithhill/rkeithhill/add-misleadingback…
daviwil Nov 5, 2016
2d4012e
Merge pull request #300 from rkeithhill/rkeithhill/hit-count-breakpoint
daviwil Nov 5, 2016
f4612fe
Remove PSScriptAnalyzer submodule
Nov 18, 2016
5c33f73
Remove PSScriptAnalyzer submodule from solution
Nov 18, 2016
ea101b3
Merge pull request #302 from PowerShell/kapilmb/RemovePSSASubmodule
daviwil Nov 18, 2016
ec4d64b
Add missing file references to CoreCLR project
daviwil Nov 22, 2016
6ffdae1
Add PowerShellVersionDetails class and PowerShellVersionRequest
daviwil Nov 22, 2016
e70d3b2
Merge pull request #303 from PowerShell/daviwil/version-details
daviwil Nov 28, 2016
295c901
Fix issue with debugger output not being written for short scripts
daviwil Nov 29, 2016
1ff1618
Merge pull request #306 from PowerShell/daviwil/fix-output
daviwil Nov 29, 2016
79231fc
Improve PowerShell version and architecture gathering
daviwil Dec 1, 2016
c42d3c2
Merge pull request #307 from PowerShell/daviwil/session-version-fixes
daviwil Dec 1, 2016
5f3e08e
DRAFT: Initial "code actions" support
daviwil Mar 24, 2016
5c5c84f
Fix merge conflict
Nov 19, 2016
b796521
Map DiagnosticRecord type to ScriptFileMarker type
Nov 19, 2016
24a34c1
Change correction marker message
Nov 19, 2016
a2bb4ad
Merge pull request #304 from PowerShell/kapilmb/code-actions
daviwil Dec 5, 2016
52fcf03
Wired up Show Information|Warning|Error Message
dfinke May 23, 2016
9f6316b
Wired in setStatusBarMessage
dfinke May 24, 2016
2f07d90
Moved to EditorWindow class
dfinke May 24, 2016
b68b420
Adding documentation for EditorWindow API methods
daviwil Dec 7, 2016
78b2c55
Add missing CodeActions.cs file to Nano project
daviwil Dec 7, 2016
0aaddda
Add an adjustable timeout to the .Window.SetStatusBarMessage API
daviwil Dec 7, 2016
5304a26
Add documentation comments for the MarkerCorreciton class
daviwil Dec 7, 2016
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
4 changes: 0 additions & 4 deletions .gitmodules

This file was deleted.

16 changes: 0 additions & 16 deletions PowerShellEditorServices.NoNano.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{F594E7FD-1E7
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{422E561A-8118-4BE7-A54F-9309E4F03AAE}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "submodules", "submodules", "{AF08DA0C-B0A6-47AD-AC55-E13C687D4A91}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ScriptAnalyzerEngine", "submodules\PSScriptAnalyzer\Engine\ScriptAnalyzerEngine.csproj", "{F4BDE3D0-3EEF-4157-8A3E-722DF7ADEF60}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ScriptAnalyzerBuiltinRules", "submodules\PSScriptAnalyzer\Rules\ScriptAnalyzerBuiltinRules.csproj", "{C33B6B9D-E61C-45A3-9103-895FD82A5C1E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PowerShellEditorServices", "src\PowerShellEditorServices\PowerShellEditorServices.csproj", "{81E8CBCD-6319-49E7-9662-0475BD0791F4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PowerShellEditorServices.Host", "src\PowerShellEditorServices.Host\PowerShellEditorServices.Host.csproj", "{B2F6369A-D737-4AFD-8B81-9B094DB07DA7}"
Expand Down Expand Up @@ -53,14 +47,6 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F4BDE3D0-3EEF-4157-8A3E-722DF7ADEF60}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F4BDE3D0-3EEF-4157-8A3E-722DF7ADEF60}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F4BDE3D0-3EEF-4157-8A3E-722DF7ADEF60}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F4BDE3D0-3EEF-4157-8A3E-722DF7ADEF60}.Release|Any CPU.Build.0 = Release|Any CPU
{C33B6B9D-E61C-45A3-9103-895FD82A5C1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C33B6B9D-E61C-45A3-9103-895FD82A5C1E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C33B6B9D-E61C-45A3-9103-895FD82A5C1E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C33B6B9D-E61C-45A3-9103-895FD82A5C1E}.Release|Any CPU.Build.0 = Release|Any CPU
{81E8CBCD-6319-49E7-9662-0475BD0791F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{81E8CBCD-6319-49E7-9662-0475BD0791F4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{81E8CBCD-6319-49E7-9662-0475BD0791F4}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -102,8 +88,6 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{F4BDE3D0-3EEF-4157-8A3E-722DF7ADEF60} = {AF08DA0C-B0A6-47AD-AC55-E13C687D4A91}
{C33B6B9D-E61C-45A3-9103-895FD82A5C1E} = {AF08DA0C-B0A6-47AD-AC55-E13C687D4A91}
{81E8CBCD-6319-49E7-9662-0475BD0791F4} = {EE0A010C-E246-49AE-92E7-AD4320C45086}
{B2F6369A-D737-4AFD-8B81-9B094DB07DA7} = {EE0A010C-E246-49AE-92E7-AD4320C45086}
{3A5DDD20-5BD0-42F4-89F4-ACC0CE554028} = {422E561A-8118-4BE7-A54F-9309E4F03AAE}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public async Task LaunchScript(string scriptFilePath)
await this.SendRequest(
LaunchRequest.Type,
new LaunchRequestArguments {
Program = scriptFilePath
Script = scriptFilePath
});

await this.SendRequest(ConfigurationDoneRequest.Type, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,22 @@ public class InitializeResponseBody
/// </summary>
public bool SupportsConditionalBreakpoints { get; set; }

/// <summary>
/// Gets or sets a boolean value that determines whether the debug adapter
/// supports breakpoints that break execution after a specified number of hits.
/// </summary>
public bool SupportsHitConditionalBreakpoints { get; set; }

/// <summary>
/// Gets or sets a boolean value that determines whether the debug adapter
/// supports a (side effect free) evaluate request for data hovers.
/// </summary>
public bool SupportsEvaluateForHovers { get; set; }

/// <summary>
/// Gets or sets a boolean value that determines whether the debug adapter
/// supports allowing the user to set a variable from the Variables debug windows.
/// </summary>
public bool SupportsSetVariable { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//

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

Expand All @@ -20,8 +21,14 @@ public class LaunchRequestArguments
/// <summary>
/// Gets or sets the absolute path to the program to debug.
/// </summary>
[Obsolete("This property has been deprecated in favor of the Script property.")]
public string Program { get; set; }

/// <summary>
/// Gets or sets the absolute path to the script to debug.
/// </summary>
public string Script { get; set; }

/// <summary>
/// Gets or sets a boolean value that indicates whether the script should be
/// run with (false) or without (true) debugging support.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public class SourceBreakpoint
public int? Column { get; set; }

public string Condition { get; set; }

public string HitCondition { get; set; }
}

public class SetBreakpointsResponseBody
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@ public class FunctionBreakpoint
public string Name { get; set; }

public string Condition { get; set; }

public string HitCondition { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//

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

namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
{
/// <summary>
/// SetVariable request; value of command field is "setVariable".
/// Request is initiated when user uses the debugger Variables UI to change the value of a variable.
/// </summary>
public class SetVariableRequest
{
public static readonly
RequestType<SetVariableRequestArguments, SetVariableResponseBody> Type =
RequestType<SetVariableRequestArguments, SetVariableResponseBody>.Create("setVariable");
}

[DebuggerDisplay("VariablesReference = {VariablesReference}")]
public class SetVariableRequestArguments
{
public int VariablesReference { get; set; }

public string Name { get; set; }

public string Value { get; set; }
}

public class SetVariableResponseBody
{
public string Value { get; set; }
}
}
32 changes: 32 additions & 0 deletions src/PowerShellEditorServices.Protocol/LanguageServer/CodeAction.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol;
using Newtonsoft.Json.Linq;

namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
{
public class CodeActionRequest
{
public static readonly
RequestType<CodeActionRequest, CodeActionCommand[]> Type =
RequestType<CodeActionRequest, CodeActionCommand[]>.Create("textDocument/codeAction");

public TextDocumentIdentifier TextDocument { get; set; }

public Range Range { get; set; }

public CodeActionContext Context { get; set; }
}

public class CodeActionContext
{
public Diagnostic[] Diagnostics { get; set; }
}

public class CodeActionCommand
{
public string Title { get; set; }

public string Command { get; set; }

public JArray Arguments { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,40 @@ public static readonly
RequestType<string, EditorCommandResponse> Type =
RequestType<string, EditorCommandResponse>.Create("editor/openFile");
}

public class ShowInformationMessageRequest
{
public static readonly
RequestType<string, EditorCommandResponse> Type =
RequestType<string, EditorCommandResponse>.Create("editor/showInformationMessage");
}

public class ShowWarningMessageRequest
{
public static readonly
RequestType<string, EditorCommandResponse> Type =
RequestType<string, EditorCommandResponse>.Create("editor/showWarningMessage");
}

public class ShowErrorMessageRequest
{
public static readonly
RequestType<string, EditorCommandResponse> Type =
RequestType<string, EditorCommandResponse>.Create("editor/showErrorMessage");
}

public class SetStatusBarMessageRequest
{
public static readonly
RequestType<StatusBarMessageDetails, EditorCommandResponse> Type =
RequestType<StatusBarMessageDetails, EditorCommandResponse>.Create("editor/setStatusBarMessage");
}

public class StatusBarMessageDetails
{
public string Message { get; set; }

public int? Timeout { get; set; }
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//

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

namespace Microsoft.PowerShell.EditorServices.Protocol.LanguageServer
{
public class PowerShellVersionRequest
{
public static readonly
RequestType<object, PowerShellVersionResponse> Type =
RequestType<object, PowerShellVersionResponse>.Create("powerShell/getVersion");
}

public class PowerShellVersionResponse
{
public string Version { get; set; }

public string DisplayVersion { get; set; }

public string Edition { get; set; }

public string Architecture { get; set; }

public PowerShellVersionResponse()
{
}

public PowerShellVersionResponse(PowerShellVersionDetails versionDetails)
{
this.Version = versionDetails.VersionString;
this.DisplayVersion = $"{versionDetails.Version.Major}.{versionDetails.Version.Minor}";
this.Edition = versionDetails.Edition;

switch (versionDetails.Architecture)
{
case PowerShellProcessArchitecture.X64:
this.Architecture = "x64";
break;
case PowerShellProcessArchitecture.X86:
this.Architecture = "x86";
break;
default:
this.Architecture = "Architecture Unknown";
break;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public class ServerCapabilities
public bool? DocumentSymbolProvider { get; set; }

public bool? WorkspaceSymbolProvider { get; set; }

public bool? CodeActionProvider { get; set; }
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,12 @@
<Compile Include="DebugAdapter\ConfigurationDoneRequest.cs" />
<Compile Include="DebugAdapter\ContinueRequest.cs" />
<Compile Include="DebugAdapter\SetFunctionBreakpointsRequest.cs" />
<Compile Include="DebugAdapter\SetVariableRequest.cs" />
<Compile Include="LanguageServer\EditorCommands.cs" />
<Compile Include="LanguageServer\CodeAction.cs" />
<Compile Include="LanguageServer\FindModuleRequest.cs" />
<Compile Include="LanguageServer\InstallModuleRequest.cs" />
<Compile Include="LanguageServer\PowerShellVersionRequest.cs" />
<Compile Include="MessageProtocol\Channel\NamedPipeClientChannel.cs" />
<Compile Include="MessageProtocol\Channel\NamedPipeServerChannel.cs" />
<Compile Include="MessageProtocol\Channel\TcpSocketClientChannel.cs" />
Expand Down Expand Up @@ -153,7 +156,7 @@
</PropertyGroup>
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
Expand Down
Loading