Skip to content

Add new PowerShellEditorServices.VSCode module #520

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 3 commits into from
Jun 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
32 changes: 22 additions & 10 deletions PowerShellEditorServices.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -97,10 +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
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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand All @@ -211,18 +223,18 @@ task PackageNuGet {

task PackageModule {
[System.IO.Compression.ZipFile]::CreateFromDirectory(
"$PSScriptRoot/module/PowerShellEditorServices",
"$PSScriptRoot/module/PowerShellEditorServices-$($script:FullVersion).zip",
"$PSScriptRoot/module/",
"$PSScriptRoot/PowerShellEditorServices-$($script:FullVersion).zip",
[System.IO.Compression.CompressionLevel]::Optimal,
$true)
$false)
}

task UploadArtifacts -If ($script:IsCIBuild) {
if ($env:APPVEYOR) {
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
}
}

Expand Down
17 changes: 16 additions & 1 deletion PowerShellEditorServices.sln
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Original file line number Diff line number Diff line change
@@ -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 = ''

}
Original file line number Diff line number Diff line change
@@ -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.'
}
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
Expand Down Expand Up @@ -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 = ''
Expand All @@ -127,4 +127,3 @@ PrivateData = @{
# DefaultCommandPrefix = ''

}

Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions module/PowerShellEditorServices/PowerShellEditorServices.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ''
Expand Down Expand Up @@ -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 = ''
Expand Down
9 changes: 9 additions & 0 deletions module/PowerShellEditorServices/PowerShellEditorServices.psm1
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -52,6 +57,9 @@ function Start-EditorServicesHost {
[switch]
$DebugServiceOnly,

[string[]]
$AdditionalModules = @(),

[string[]]
[ValidateNotNull()]
$FeatureFlags = @(),
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions module/Start-EditorServices.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ $editorServicesHost =
-HostVersion $HostVersion `
-LogPath $LogPath `
-LogLevel $LogLevel `
-AdditionalModules @() `
-LanguageServicePort $languageServicePort `
-DebugServicePort $debugServicePort `
-BundledModulesPath $BundledModulesPath `
Expand Down
Loading