Skip to content

Commit 98dd05b

Browse files
committed
Initial commit for 0.1.0-preview
This commit establishes the codebase for the initial release of Windows PowerShell for Visual Studio Code.
1 parent 84eb0d9 commit 98dd05b

38 files changed

+6261
-19
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
bin/
2+
out/
3+
node_modules/
4+
vscode-powershell.zip
5+
vscps-preview.zip

.vscode/launch.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"version": "0.1.0",
3+
"configurations": [
4+
{
5+
"request": "launch",
6+
"name": "Launch Extension",
7+
"type": "extensionHost",
8+
//"runtimeExecutable": "${execPath}",
9+
"runtimeExecutable": "c:/dev/Monaco/tools/code.bat",
10+
"args": [
11+
"--extensionDevelopmentPath=${workspaceRoot}",
12+
"c:/Users/daviwil/Documents/DemoFiles"
13+
],
14+
"stopOnEntry": false,
15+
"sourceMaps": true,
16+
"outDir": "out",
17+
"preLaunchTask": "npm"
18+
},
19+
{
20+
"name": "Attach",
21+
"type": "node",
22+
"address": "localhost",
23+
"port": 5858,
24+
"sourceMaps": false
25+
}
26+
]
27+
}

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Place your settings in this file to overwrite default and user settings.
2+
{
3+
}

.vscode/tasks.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Available variables which can be used inside of strings.
2+
// ${workspaceRoot}: the root folder of the team
3+
// ${file}: the current opened file
4+
// ${fileBasename}: the current opened file's basename
5+
// ${fileDirname}: the current opened file's dirname
6+
// ${fileExtname}: the current opened file's extension
7+
// ${cwd}: the current working directory of the spawned process
8+
9+
// A task runner that calls a custom npm script that compiles the extension.
10+
{
11+
"version": "0.1.0",
12+
13+
// we want to run npm
14+
"command": "npm",
15+
16+
// the command is a shell script
17+
"isShellCommand": true,
18+
19+
// show the output window only if unrecognized errors occur.
20+
"showOutput": "silent",
21+
22+
// we run the custom script "compile" as defined in package.json
23+
"args": ["run", "compile"],
24+
25+
// The tsc compiler is started in watching mode
26+
"isWatching": true,
27+
28+
// use the standard tsc in watch mode problem matcher to find compile problems in the output.
29+
"problemMatcher": "$tsc-watch"
30+
}

.vscodeignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.vscode/**
2+
typings/**
3+
node_modules/vscode/**
4+
node_modules/vscode-languageworker/**
5+
**/*.ts
6+
.gitignore
7+
tsconfig.json
8+
bin/EditorServices.log
9+
bin/*.vshost.*

LICENSE

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,13 @@
1-
The MIT License (MIT)
1+
Windows PowerShell for Visual Studio Code 0.1.0
2+
Copyright (c) Microsoft Corporation
23

3-
Copyright (c) 2015 PowerShell
4+
All rights reserved.
45

5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
6+
MIT License
117

12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
8+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
149

15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
10+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11+
12+
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2213

README.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,34 @@
1-
# VSCodePowerShell
2-
PowerShell language support for Visual Studio Code text editor
1+
# Windows PowerShell for Visual Studio Code
2+
3+
Windows PowerShell language support for Visual Studio Code.
4+
More details forthcoming.
5+
6+
## Building the code
7+
8+
`npm run compile`
9+
10+
After the initial compile, the source files will be watched and recompiled
11+
when changes are saved.
12+
13+
## Running the compiled code
14+
15+
From a PowerShell or cmd.exe prompt, run the following command:
16+
17+
`code --extensionDevelopmentPath="c:\path\to\vscode-powershell" .`
18+
19+
If you allow the compiler to continue watching for file changes, you can use
20+
the `Reload Window` command found in the command palette `(Ctrl+Shift+P)`
21+
so that the new source files are loaded.
22+
23+
## Example Scripts
24+
25+
There are some example scripts in the `examples` folder that you can
26+
use to discover PowerShell editing and debugging functionality. Please
27+
check out the [README.md](examples/README.md) file to learn more about
28+
how to use them.
29+
30+
## License
31+
32+
This project is [licensed under the MIT License](LICENSE). Please see the
33+
[third-party notices](Third Party Notices.txt) file for details on the third-party
34+
binaries that we include with releases of this project.

Third Party Notices.txt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
This file is based on or incorporates material from the projects listed below (Third Party IP). The original copyright notice and the license under which Microsoft received such Third Party IP, are set forth below. Such licenses and notices are provided for informational purposes only. Microsoft licenses the Third Party IP to you under the licensing terms for the Microsoft product. Microsoft reserves all other rights not expressly granted under this agreement, whether by implication, estoppel or otherwise.
2+
3+
---
4+
5+
Json.NET
6+
7+
Copyright (c) 2007 James Newton-King
8+
Provided for Informational Purposes Only
9+
10+
MIT License
11+
12+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
13+
14+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
17+
18+
---
19+
20+
AsyncEx
21+
22+
Copyright (c) 2014 StephenCleary
23+
Provided for Informational Purposes Only
24+
25+
MIT License
26+
27+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
28+
29+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
30+
31+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

build/InstallPreview.ps1

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
# Make sure VS Code isn't running first
3+
$ErrorActionPreference = "SilentlyContinue"
4+
if ((Get-Process -Name "Code").Count -gt 0)
5+
{
6+
Write-Warning "Visual Studio Code is currently running. You must close all VS Code windows before continuing."
7+
}
8+
else
9+
{
10+
# Fail fast on future errors
11+
$ErrorActionPreference = "Stop"
12+
13+
$destPath = "$env:USERPROFILE\.vscode\extensions\vscode-powershell\"
14+
15+
if (Test-Path $destPath)
16+
{
17+
Remove-Item $destPath -Recurse
18+
}
19+
20+
Write-Output "Installing to $destPath"
21+
Expand-Archive -Path ".\vscode-powershell.zip" -DestinationPath $destPath
22+
23+
if ($?)
24+
{
25+
Write-Output "Installation complete!"
26+
Write-Output ""
27+
Write-Output "Launching Visual Studio Code..."
28+
29+
& "${env:ProgramFiles(x86)}\Microsoft VS Code\Code.exe" "$destPath\examples\" "$destPath\examples\README.md" 2>&1 | Out-Null
30+
}
31+
else
32+
{
33+
Write-Output "Installation failed!"
34+
}
35+
}

build/PackagePreviewRelease.ps1

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
param([string]$EditorServicesRepoPath = "")
2+
3+
$ErrorActionPreference = "Stop"
4+
5+
# Simple test to make sure we're in the root folder
6+
if (!(Test-Path "package.json"))
7+
{
8+
throw "This script must be run from the root vscode-powershell folder (contains package.json)."
9+
}
10+
11+
if ([string]::IsNullOrEmpty($EditorServicesRepoPath) -or !(Test-Path $EditorServicesRepoPath))
12+
{
13+
throw "Must provide path to a PowerShell Editor Services Git repository"
14+
}
15+
16+
$hostBinPath = Join-Path $EditorServicesRepoPath "src\PowerShellEditorServices.Host\bin\Debug"
17+
18+
if (!(Test-Path $hostBinPath))
19+
{
20+
throw "The path '$hostBinPath' was not found. Has the Editor Services solution been compiled?"
21+
}
22+
23+
Remove-Item -Path ".\bin\*"
24+
Copy-Item -Path "$hostBinPath\*" -Include ("*.exe", "*.dll", "*.pdb", "*.xml") -Exclude ("*.vshost.exe") -Destination ".\bin"
25+
26+
$packageFiles = @(
27+
"out",
28+
"bin",
29+
#"LICENSE",
30+
"package.json",
31+
#"README.md",
32+
"Third Party Notices.txt",
33+
"snippets",
34+
"examples"
35+
)
36+
37+
# Build the extension files package
38+
Compress-Archive -DestinationPath "vscode-powershell.zip" -Path $packageFiles -Force
39+
40+
# Build the release package
41+
Compress-Archive -DestinationPath "vscps-preview.zip" -Path @(".\build\InstallPreview.ps1", "vscode-powershell.zip") -Force
42+
43+
Write-Output "Packaging complete."

0 commit comments

Comments
 (0)