From 4ee75b29540a79bbb1f717bac1578d45ffc69b2e Mon Sep 17 00:00:00 2001 From: David Wilson Date: Fri, 16 Jun 2017 17:28:56 -0700 Subject: [PATCH 1/3] Add new PowerShellEditorServices.VSCode module This change introduces a new module named PowerShellEditorServices.VSCode which provides functionality that is meant to be used only with the PowerShell extension for Visual Studio Code. It also adds the necessary infrastructure to load this module when the language service starts up. --- PowerShellEditorServices.build.ps1 | 22 +++- PowerShellEditorServices.sln | 17 ++- .../PowerShellEditorServices.VSCode.psd1 | 122 ++++++++++++++++++ .../PowerShellEditorServices.VSCode.psm1 | 18 +++ module/Start-EditorServices.ps1 | 1 + .../EditorServicesHost.cs | 14 ++ .../ComponentRegistration.cs | 20 +++ .../PowerShellEditorServices.VSCode.csproj | 26 ++++ 8 files changed, 234 insertions(+), 6 deletions(-) create mode 100644 module/PowerShellEditorServices.VSCode/PowerShellEditorServices.VSCode.psd1 create mode 100644 module/PowerShellEditorServices.VSCode/PowerShellEditorServices.VSCode.psm1 create mode 100644 src/PowerShellEditorServices.VSCode/ComponentRegistration.cs create mode 100644 src/PowerShellEditorServices.VSCode/PowerShellEditorServices.VSCode.csproj diff --git a/PowerShellEditorServices.build.ps1 b/PowerShellEditorServices.build.ps1 index b75cb7e10..7af2cc282 100644 --- a/PowerShellEditorServices.build.ps1 +++ b/PowerShellEditorServices.build.ps1 @@ -22,7 +22,6 @@ task SetupDotNet -Before Restore, Clean, Build, TestHost, TestServer, TestProtoc $requiredSdkVersion = "1.0.0" - $needsInstall = $true $dotnetPath = "$PSScriptRoot/.dotnet" $dotnetExePath = if ($script:IsUnix) { "$dotnetPath/dotnet" } else { "$dotnetPath/dotnet.exe" } $originalDotNetExePath = $dotnetExePath @@ -98,8 +97,9 @@ task Restore -If { "Restore" -in $BuildTask -or (NeedsRestore(".\src")) -or (Nee task Clean { exec { & $script:dotnetExe clean } Remove-Item .\module\PowerShellEditorServices\bin -Recurse -Force -ErrorAction Ignore + Remove-Item .\module\PowerShellEditorServices.VSCode\bin -Recurse -Force -ErrorAction Ignore Get-ChildItem -Recurse src\*.nupkg | Remove-Item -Force -ErrorAction Ignore - Get-ChildItem .\module\PowerShellEditorServices\*.zip | Remove-Item -Force -ErrorAction Ignore + Get-ChildItem .\module\PowerShellEditorServices*.zip | Remove-Item -Force -ErrorAction Ignore Get-ChildItem .\module\PowerShellEditorServices\Commands\en-US\*-help.xml | Remove-Item -Force -ErrorAction Ignore } @@ -144,6 +144,7 @@ task TestPowerShellApi -If { !$script:IsUnix } { task Build { exec { & $script:dotnetExe build -c $Configuration .\src\PowerShellEditorServices.Host\PowerShellEditorServices.Host.csproj $script:TargetFrameworksParam } + exec { & $script:dotnetExe build -c $Configuration .\src\PowerShellEditorServices.VSCode\PowerShellEditorServices.VSCode.csproj $script:TargetFrameworksParam } } function UploadTestLogs { @@ -188,15 +189,26 @@ task CITest (job Test -Safe), { } task LayoutModule -After Build { + # Lay out the PowerShellEditorServices module's binaries New-Item -Force $PSScriptRoot\module\PowerShellEditorServices\bin\ -Type Directory | Out-Null New-Item -Force $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop -Type Directory | Out-Null New-Item -Force $PSScriptRoot\module\PowerShellEditorServices\bin\Core -Type Directory | Out-Null + Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\netstandard1.6\* -Filter Microsoft.PowerShell.EditorServices*.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Core\ if (!$script:IsUnix) { Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\net451\* -Filter Microsoft.PowerShell.EditorServices*.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\ Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\net451\Newtonsoft.Json.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Desktop\ } - Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.Host\bin\$Configuration\netstandard1.6\* -Filter Microsoft.PowerShell.EditorServices*.dll -Destination $PSScriptRoot\module\PowerShellEditorServices\bin\Core\ + + # Lay out the PowerShellEditorServices.VSCode module's binaries + New-Item -Force $PSScriptRoot\module\PowerShellEditorServices.VSCode\bin\ -Type Directory | Out-Null + New-Item -Force $PSScriptRoot\module\PowerShellEditorServices.VSCode\bin\Desktop -Type Directory | Out-Null + New-Item -Force $PSScriptRoot\module\PowerShellEditorServices.VSCode\bin\Core -Type Directory | Out-Null + + Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.VSCode\bin\$Configuration\netstandard1.6\* -Filter Microsoft.PowerShell.EditorServices.VSCode*.dll -Destination $PSScriptRoot\module\PowerShellEditorServices.VSCode\bin\Core\ + if (!$script:IsUnix) { + Copy-Item -Force -Path $PSScriptRoot\src\PowerShellEditorServices.VSCode\bin\$Configuration\net451\* -Filter Microsoft.PowerShell.EditorServices.VSCode*.dll -Destination $PSScriptRoot\module\PowerShellEditorServices.VSCode\bin\Desktop\ + } } task BuildCmdletHelp { @@ -211,10 +223,10 @@ task PackageNuGet { task PackageModule { [System.IO.Compression.ZipFile]::CreateFromDirectory( - "$PSScriptRoot/module/PowerShellEditorServices", + "$PSScriptRoot/module/", "$PSScriptRoot/module/PowerShellEditorServices-$($script:FullVersion).zip", [System.IO.Compression.CompressionLevel]::Optimal, - $true) + $false) } task UploadArtifacts -If ($script:IsCIBuild) { diff --git a/PowerShellEditorServices.sln b/PowerShellEditorServices.sln index 767d68c47..6c3671bb0 100644 --- a/PowerShellEditorServices.sln +++ b/PowerShellEditorServices.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26228.9 +VisualStudioVersion = 15.0.26430.12 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{F594E7FD-1E72-4E51-A496-B019C2BA3180}" EndProject @@ -26,6 +26,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PowerShellEditorServices.Pr EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PowerShellEditorServices.Test.Protocol", "test\PowerShellEditorServices.Test.Protocol\PowerShellEditorServices.Test.Protocol.csproj", "{E3A5CF5D-6E41-44AC-AE0A-4C227E4BACD4}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PowerShellEditorServices.VSCode", "src\PowerShellEditorServices.VSCode\PowerShellEditorServices.VSCode.csproj", "{3B38E8DA-8BFF-4264-AF16-47929E6398A3}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -120,6 +122,18 @@ Global {E3A5CF5D-6E41-44AC-AE0A-4C227E4BACD4}.Release|x64.Build.0 = Release|Any CPU {E3A5CF5D-6E41-44AC-AE0A-4C227E4BACD4}.Release|x86.ActiveCfg = Release|Any CPU {E3A5CF5D-6E41-44AC-AE0A-4C227E4BACD4}.Release|x86.Build.0 = Release|Any CPU + {3B38E8DA-8BFF-4264-AF16-47929E6398A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3B38E8DA-8BFF-4264-AF16-47929E6398A3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3B38E8DA-8BFF-4264-AF16-47929E6398A3}.Debug|x64.ActiveCfg = Debug|Any CPU + {3B38E8DA-8BFF-4264-AF16-47929E6398A3}.Debug|x64.Build.0 = Debug|Any CPU + {3B38E8DA-8BFF-4264-AF16-47929E6398A3}.Debug|x86.ActiveCfg = Debug|Any CPU + {3B38E8DA-8BFF-4264-AF16-47929E6398A3}.Debug|x86.Build.0 = Debug|Any CPU + {3B38E8DA-8BFF-4264-AF16-47929E6398A3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3B38E8DA-8BFF-4264-AF16-47929E6398A3}.Release|Any CPU.Build.0 = Release|Any CPU + {3B38E8DA-8BFF-4264-AF16-47929E6398A3}.Release|x64.ActiveCfg = Release|Any CPU + {3B38E8DA-8BFF-4264-AF16-47929E6398A3}.Release|x64.Build.0 = Release|Any CPU + {3B38E8DA-8BFF-4264-AF16-47929E6398A3}.Release|x86.ActiveCfg = Release|Any CPU + {3B38E8DA-8BFF-4264-AF16-47929E6398A3}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -132,5 +146,6 @@ Global {6A20B9E9-DE66-456E-B4F5-ACFD1A95C3CA} = {422E561A-8118-4BE7-A54F-9309E4F03AAE} {F8A0946A-5D25-4651-8079-B8D5776916FB} = {F594E7FD-1E72-4E51-A496-B019C2BA3180} {E3A5CF5D-6E41-44AC-AE0A-4C227E4BACD4} = {422E561A-8118-4BE7-A54F-9309E4F03AAE} + {3B38E8DA-8BFF-4264-AF16-47929E6398A3} = {F594E7FD-1E72-4E51-A496-B019C2BA3180} EndGlobalSection EndGlobal diff --git a/module/PowerShellEditorServices.VSCode/PowerShellEditorServices.VSCode.psd1 b/module/PowerShellEditorServices.VSCode/PowerShellEditorServices.VSCode.psd1 new file mode 100644 index 000000000..3289f6235 --- /dev/null +++ b/module/PowerShellEditorServices.VSCode/PowerShellEditorServices.VSCode.psd1 @@ -0,0 +1,122 @@ +# +# Module manifest for module 'PowerShellEditorServices.VSCode' +# +# Generated by: daviwil +# +# Generated on: 6/16/2017 +# + +@{ + +# Script module or binary module file associated with this manifest. +RootModule = 'PowerShellEditorServices.VSCode.psm1' + +# Version number of this module. +ModuleVersion = '0.1.0' + +# Supported PSEditions +# CompatiblePSEditions = @() + +# ID used to uniquely identify this module +GUID = '8794484f-cfc3-40f1-b88f-a934f403e679' + +# Author of this module +Author = 'Microsoft' + +# Company or vendor of this module +CompanyName = 'Microsoft' + +# Copyright statement for this module +Copyright = '(c) 2017 Microsoft. All rights reserved.' + +# Description of the functionality provided by this module +Description = 'Provides added functionality to PowerShell Editor Services for the Visual Studio Code editor.' + +# Minimum version of the Windows PowerShell engine required by this module +# PowerShellVersion = '' + +# Name of the Windows PowerShell host required by this module +# PowerShellHostName = '' + +# Minimum version of the Windows PowerShell host required by this module +# PowerShellHostVersion = '' + +# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. +# DotNetFrameworkVersion = '' + +# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. +# CLRVersion = '' + +# Processor architecture (None, X86, Amd64) required by this module +# ProcessorArchitecture = '' + +# Modules that must be imported into the global environment prior to importing this module +# RequiredModules = @() + +# Assemblies that must be loaded prior to importing this module +# RequiredAssemblies = @() + +# Script files (.ps1) that are run in the caller's environment prior to importing this module. +# ScriptsToProcess = @() + +# Type files (.ps1xml) to be loaded when importing this module +# TypesToProcess = @() + +# Format files (.ps1xml) to be loaded when importing this module +# FormatsToProcess = @() + +# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess +# NestedModules = @() + +# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. +FunctionsToExport = @() + +# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. +CmdletsToExport = @() + +# Variables to export from this module +VariablesToExport = '*' + +# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. +AliasesToExport = @() + +# DSC resources to export from this module +# DscResourcesToExport = @() + +# List of all modules packaged with this module +# ModuleList = @() + +# List of all files packaged with this module +# FileList = @() + +# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. +PrivateData = @{ + + PSData = @{ + + # Tags applied to this module. These help with module discovery in online galleries. + # Tags = @() + + # A URL to the license for this module. + LicenseUri = 'https://github.com/PowerShell/PowerShellEditorServices/blob/master/LICENSE' + + # A URL to the main website for this project. + ProjectUri = 'https://github.com/PowerShell/PowerShellEditorServices' + + # A URL to an icon representing this module. + # IconUri = '' + + # ReleaseNotes of this module + # ReleaseNotes = '' + + } # End of PSData hashtable + +} # End of PrivateData hashtable + +# HelpInfo URI of this module +# HelpInfoURI = '' + +# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. +# DefaultCommandPrefix = '' + +} diff --git a/module/PowerShellEditorServices.VSCode/PowerShellEditorServices.VSCode.psm1 b/module/PowerShellEditorServices.VSCode/PowerShellEditorServices.VSCode.psm1 new file mode 100644 index 000000000..4ecd517e2 --- /dev/null +++ b/module/PowerShellEditorServices.VSCode/PowerShellEditorServices.VSCode.psm1 @@ -0,0 +1,18 @@ +# +# Copyright (c) Microsoft. All rights reserved. +# Licensed under the MIT license. See LICENSE file in the project root for full license information. +# + +if (!$PSVersionTable.PSEdition -or $PSVersionTable.PSEdition -eq "Desktop") { + Add-Type -Path "$PSScriptRoot/bin/Desktop/Microsoft.PowerShell.EditorServices.VSCode.dll" +} +else { + Add-Type -Path "$PSScriptRoot/bin/Core/Microsoft.PowerShell.EditorServices.VSCode.dll" +} + +if ($psEditor -is [Microsoft.PowerShell.EditorServices.Extensions.EditorObject]) { + [Microsoft.PowerShell.EditorServices.VSCode.ComponentRegistration]::Register($psEditor.Components) +} +else { + Write-Verbose '$psEditor object not found in the session, components will not be registered.' +} diff --git a/module/Start-EditorServices.ps1 b/module/Start-EditorServices.ps1 index cc6c15139..c5a402486 100644 --- a/module/Start-EditorServices.ps1 +++ b/module/Start-EditorServices.ps1 @@ -159,6 +159,7 @@ $editorServicesHost = -HostVersion $HostVersion ` -LogPath $LogPath ` -LogLevel $LogLevel ` + -AdditionalModules @() ` -LanguageServicePort $languageServicePort ` -DebugServicePort $debugServicePort ` -BundledModulesPath $BundledModulesPath ` diff --git a/src/PowerShellEditorServices.Host/EditorServicesHost.cs b/src/PowerShellEditorServices.Host/EditorServicesHost.cs index c3807f4c2..ba369fd7f 100644 --- a/src/PowerShellEditorServices.Host/EditorServicesHost.cs +++ b/src/PowerShellEditorServices.Host/EditorServicesHost.cs @@ -43,6 +43,7 @@ public class EditorServicesHost private ProfilePaths profilePaths; private string bundledModulesPath; private DebugAdapter debugAdapter; + private string[] additionalModules; private EditorSession editorSession; private HashSet featureFlags; private LanguageServer languageServer; @@ -78,6 +79,7 @@ public EditorServicesHost( string bundledModulesPath, bool enableConsoleRepl, bool waitForDebugger, + string[] additionalModules, string[] featureFlags) { Validate.IsNotNull(nameof(hostDetails), hostDetails); @@ -85,6 +87,7 @@ public EditorServicesHost( this.hostDetails = hostDetails; this.enableConsoleRepl = enableConsoleRepl; this.bundledModulesPath = bundledModulesPath; + this.additionalModules = additionalModules ?? new string[0]; this.featureFlags = new HashSet(featureFlags ?? new string[0]); #if DEBUG @@ -216,6 +219,17 @@ await this.editorSession.PowerShellContext.ImportCommandsModule( @"..\..\Commands")); this.languageServer.Start(); + + // TODO: This can be moved to the point after the $psEditor object + // gets initialized when that is done earlier than LanguageServer.Initialize + foreach (string module in this.additionalModules) + { + await this.editorSession.PowerShellContext.ExecuteCommand( + new System.Management.Automation.PSCommand().AddCommand("Import-Module").AddArgument(module), + false, + true); + } + protocolEndpoint.Start(); } diff --git a/src/PowerShellEditorServices.VSCode/ComponentRegistration.cs b/src/PowerShellEditorServices.VSCode/ComponentRegistration.cs new file mode 100644 index 000000000..de76c5c33 --- /dev/null +++ b/src/PowerShellEditorServices.VSCode/ComponentRegistration.cs @@ -0,0 +1,20 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// + +using System; +using Microsoft.PowerShell.EditorServices.Components; +using Microsoft.PowerShell.EditorServices.Utility; + +namespace Microsoft.PowerShell.EditorServices.VSCode +{ + public static class ComponentRegistration + { + public static void Register(IComponentRegistry components) + { + ILogger logger = components.Get(); + logger.Write(LogLevel.Normal, "PowerShell Editor Services VS Code module loaded."); + } + } +} diff --git a/src/PowerShellEditorServices.VSCode/PowerShellEditorServices.VSCode.csproj b/src/PowerShellEditorServices.VSCode/PowerShellEditorServices.VSCode.csproj new file mode 100644 index 000000000..a587f2eae --- /dev/null +++ b/src/PowerShellEditorServices.VSCode/PowerShellEditorServices.VSCode.csproj @@ -0,0 +1,26 @@ + + + + + PowerShell Editor Services, Visual Studio Code Extensions + Provides added functionality to PowerShell Editor Services for the Visual Studio Code editor. + net451;netstandard1.6 + Microsoft.PowerShell.EditorServices.VSCode + $(PackageTargetFallback);dnxcore50;portable-net45+win8 + + + + + + + + + + $(DefineConstants);CoreCLR + + + + + + + From 0283d5f1ad8dc32237bdc58e546e26c051d88ef6 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Fri, 16 Jun 2017 17:30:16 -0700 Subject: [PATCH 2/3] Improve existing .psd1 and .psm1 files for consistency --- .../Commands/PowerShellEditorServices.Commands.psd1 | 7 +++---- .../Commands/PowerShellEditorServices.Commands.psm1 | 5 +++++ .../PowerShellEditorServices.psd1 | 6 +++--- .../PowerShellEditorServices.psm1 | 9 +++++++++ 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/module/PowerShellEditorServices/Commands/PowerShellEditorServices.Commands.psd1 b/module/PowerShellEditorServices/Commands/PowerShellEditorServices.Commands.psd1 index cd4bf764c..e10be4c34 100644 --- a/module/PowerShellEditorServices/Commands/PowerShellEditorServices.Commands.psd1 +++ b/module/PowerShellEditorServices/Commands/PowerShellEditorServices.Commands.psd1 @@ -24,7 +24,7 @@ Author = 'Microsoft' CompanyName = 'Microsoft' # Copyright statement for this module -Copyright = '(c) 2016 Microsoft. All rights reserved.' +Copyright = '(c) 2017 Microsoft. All rights reserved.' # Description of the functionality provided by this module Description = 'Provides internal commands for PowerShell Editor Services that only work in an editor session.' @@ -105,10 +105,10 @@ PrivateData = @{ # Tags = @() # A URL to the license for this module. - # LicenseUri = '' + LicenseUri = 'https://github.com/PowerShell/PowerShellEditorServices/blob/master/LICENSE' # A URL to the main website for this project. - # ProjectUri = '' + ProjectUri = 'https://github.com/PowerShell/PowerShellEditorServices' # A URL to an icon representing this module. # IconUri = '' @@ -127,4 +127,3 @@ PrivateData = @{ # DefaultCommandPrefix = '' } - diff --git a/module/PowerShellEditorServices/Commands/PowerShellEditorServices.Commands.psm1 b/module/PowerShellEditorServices/Commands/PowerShellEditorServices.Commands.psm1 index 8738cc1d6..ae745b604 100644 --- a/module/PowerShellEditorServices/Commands/PowerShellEditorServices.Commands.psm1 +++ b/module/PowerShellEditorServices/Commands/PowerShellEditorServices.Commands.psm1 @@ -1,3 +1,8 @@ +# +# Copyright (c) Microsoft. All rights reserved. +# Licensed under the MIT license. See LICENSE file in the project root for full license information. +# + Import-LocalizedData -BindingVariable Strings -FileName Strings -ErrorAction Ignore Get-ChildItem -Path $PSScriptRoot\Public\*.ps1 | ForEach-Object { diff --git a/module/PowerShellEditorServices/PowerShellEditorServices.psd1 b/module/PowerShellEditorServices/PowerShellEditorServices.psd1 index 4538a11a6..4c01d8381 100644 --- a/module/PowerShellEditorServices/PowerShellEditorServices.psd1 +++ b/module/PowerShellEditorServices/PowerShellEditorServices.psd1 @@ -24,7 +24,7 @@ Author = 'Microsoft' CompanyName = 'Microsoft' # Copyright statement for this module -Copyright = '(c) 2016 Microsoft. All rights reserved.' +Copyright = '(c) 2017 Microsoft. All rights reserved.' # Description of the functionality provided by this module # Description = '' @@ -95,10 +95,10 @@ PrivateData = @{ # Tags = @() # A URL to the license for this module. - # LicenseUri = '' + LicenseUri = 'https://github.com/PowerShell/PowerShellEditorServices/blob/master/LICENSE' # A URL to the main website for this project. - # ProjectUri = '' + ProjectUri = 'https://github.com/PowerShell/PowerShellEditorServices' # A URL to an icon representing this module. # IconUri = '' diff --git a/module/PowerShellEditorServices/PowerShellEditorServices.psm1 b/module/PowerShellEditorServices/PowerShellEditorServices.psm1 index de47ff7b3..ada179274 100644 --- a/module/PowerShellEditorServices/PowerShellEditorServices.psm1 +++ b/module/PowerShellEditorServices/PowerShellEditorServices.psm1 @@ -1,3 +1,8 @@ +# +# Copyright (c) Microsoft. All rights reserved. +# Licensed under the MIT license. See LICENSE file in the project root for full license information. +# + if (!$PSVersionTable.PSEdition -or $PSVersionTable.PSEdition -eq "Desktop") { Add-Type -Path "$PSScriptRoot/bin/Desktop/Microsoft.PowerShell.EditorServices.dll" Add-Type -Path "$PSScriptRoot/bin/Desktop/Microsoft.PowerShell.EditorServices.Host.dll" @@ -52,6 +57,9 @@ function Start-EditorServicesHost { [switch] $DebugServiceOnly, + [string[]] + $AdditionalModules = @(), + [string[]] [ValidateNotNull()] $FeatureFlags = @(), @@ -69,6 +77,7 @@ function Start-EditorServicesHost { $BundledModulesPath, $EnableConsoleRepl.IsPresent, $WaitForDebugger.IsPresent, + $AdditionalModules, $FeatureFlags) # Build the profile paths using the root paths of the current $profile variable From f8d104ddc00da34833e70717d2bbbe6eff66f850 Mon Sep 17 00:00:00 2001 From: David Wilson Date: Sat, 17 Jun 2017 08:28:16 -0700 Subject: [PATCH 3/3] Change module package generation output path --- PowerShellEditorServices.build.ps1 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/PowerShellEditorServices.build.ps1 b/PowerShellEditorServices.build.ps1 index 7af2cc282..585b21664 100644 --- a/PowerShellEditorServices.build.ps1 +++ b/PowerShellEditorServices.build.ps1 @@ -96,11 +96,11 @@ task Restore -If { "Restore" -in $BuildTask -or (NeedsRestore(".\src")) -or (Nee task Clean { exec { & $script:dotnetExe clean } - Remove-Item .\module\PowerShellEditorServices\bin -Recurse -Force -ErrorAction Ignore - Remove-Item .\module\PowerShellEditorServices.VSCode\bin -Recurse -Force -ErrorAction Ignore - Get-ChildItem -Recurse src\*.nupkg | Remove-Item -Force -ErrorAction Ignore - Get-ChildItem .\module\PowerShellEditorServices*.zip | Remove-Item -Force -ErrorAction Ignore - Get-ChildItem .\module\PowerShellEditorServices\Commands\en-US\*-help.xml | Remove-Item -Force -ErrorAction Ignore + Remove-Item $PSScriptRoot\module\PowerShellEditorServices\bin -Recurse -Force -ErrorAction Ignore + Remove-Item $PSScriptRoot\module\PowerShellEditorServices.VSCode\bin -Recurse -Force -ErrorAction Ignore + Get-ChildItem -Recurse $PSScriptRoot\src\*.nupkg | Remove-Item -Force -ErrorAction Ignore + Get-ChildItem $PSScriptRoot\PowerShellEditorServices*.zip | Remove-Item -Force -ErrorAction Ignore + Get-ChildItem $PSScriptRoot\module\PowerShellEditorServices\Commands\en-US\*-help.xml | Remove-Item -Force -ErrorAction Ignore } task GetProductVersion -Before PackageNuGet, PackageModule, UploadArtifacts { @@ -224,7 +224,7 @@ task PackageNuGet { task PackageModule { [System.IO.Compression.ZipFile]::CreateFromDirectory( "$PSScriptRoot/module/", - "$PSScriptRoot/module/PowerShellEditorServices-$($script:FullVersion).zip", + "$PSScriptRoot/PowerShellEditorServices-$($script:FullVersion).zip", [System.IO.Compression.CompressionLevel]::Optimal, $false) } @@ -234,7 +234,7 @@ task UploadArtifacts -If ($script:IsCIBuild) { Push-AppveyorArtifact .\src\PowerShellEditorServices\bin\$Configuration\Microsoft.PowerShell.EditorServices.$($script:FullVersion).nupkg Push-AppveyorArtifact .\src\PowerShellEditorServices.Protocol\bin\$Configuration\Microsoft.PowerShell.EditorServices.Protocol.$($script:FullVersion).nupkg Push-AppveyorArtifact .\src\PowerShellEditorServices.Host\bin\$Configuration\Microsoft.PowerShell.EditorServices.Host.$($script:FullVersion).nupkg - Push-AppveyorArtifact .\module\PowerShellEditorServices-$($script:FullVersion).zip + Push-AppveyorArtifact .\PowerShellEditorServices-$($script:FullVersion).zip } }