Merge commit 'be3e8236086165e5e45a5a10783823874b3f3ebd' as 'lib/vscode'
This commit is contained in:
2
lib/vscode/extensions/powershell/.vscodeignore
Normal file
2
lib/vscode/extensions/powershell/.vscodeignore
Normal file
@ -0,0 +1,2 @@
|
||||
test/**
|
||||
cgmanifest.json
|
17
lib/vscode/extensions/powershell/cgmanifest.json
Normal file
17
lib/vscode/extensions/powershell/cgmanifest.json
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"registrations": [
|
||||
{
|
||||
"component": {
|
||||
"type": "git",
|
||||
"git": {
|
||||
"name": "PowerShell/EditorSyntax",
|
||||
"repositoryUrl": "https://github.com/PowerShell/EditorSyntax",
|
||||
"commitHash": "d10ae29c0d3ceb248172c383a159ae43b9ccfb4d"
|
||||
}
|
||||
},
|
||||
"license": "MIT",
|
||||
"version": "1.0.0"
|
||||
}
|
||||
],
|
||||
"version": 1
|
||||
}
|
34
lib/vscode/extensions/powershell/language-configuration.json
Normal file
34
lib/vscode/extensions/powershell/language-configuration.json
Normal file
@ -0,0 +1,34 @@
|
||||
{
|
||||
"comments": {
|
||||
"lineComment": "#",
|
||||
"blockComment": [ "<#", "#>" ]
|
||||
},
|
||||
"brackets": [
|
||||
["{", "}"],
|
||||
["[", "]"],
|
||||
["(", ")"]
|
||||
],
|
||||
"autoClosingPairs": [
|
||||
["{", "}"],
|
||||
["[", "]"],
|
||||
["(", ")"],
|
||||
{ "open": "@'", "close": "\n'@", "notIn": ["string", "comment"]},
|
||||
{ "open": "@\"", "close": "\n\"@", "notIn": ["string", "comment"]},
|
||||
{ "open": "\"", "close": "\"", "notIn": ["string"]},
|
||||
{ "open": "'", "close": "'", "notIn": ["string", "comment"]},
|
||||
["<#", "#>"]
|
||||
],
|
||||
"surroundingPairs": [
|
||||
["{", "}"],
|
||||
["[", "]"],
|
||||
["(", ")"],
|
||||
["\"", "\""],
|
||||
["'", "'"]
|
||||
],
|
||||
"folding": {
|
||||
"markers": {
|
||||
"start": "^\\s*#[rR]egion\\b",
|
||||
"end": "^\\s*#[eE]nd[rR]egion\\b"
|
||||
}
|
||||
}
|
||||
}
|
30
lib/vscode/extensions/powershell/package.json
Normal file
30
lib/vscode/extensions/powershell/package.json
Normal file
@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "powershell",
|
||||
"displayName": "%displayName%",
|
||||
"description": "%description%",
|
||||
"version": "1.0.0",
|
||||
"publisher": "vscode",
|
||||
"license": "MIT",
|
||||
"engines": { "vscode": "*" },
|
||||
"contributes": {
|
||||
"languages": [{
|
||||
"id": "powershell",
|
||||
"extensions": [ ".ps1", ".psm1", ".psd1", ".pssc", ".psrc" ],
|
||||
"aliases": [ "PowerShell", "powershell", "ps", "ps1" ],
|
||||
"firstLine": "^#!\\s*/.*\\bpwsh\\b",
|
||||
"configuration": "./language-configuration.json"
|
||||
}],
|
||||
"grammars": [{
|
||||
"language": "powershell",
|
||||
"scopeName": "source.powershell",
|
||||
"path": "./syntaxes/powershell.tmLanguage.json"
|
||||
}],
|
||||
"snippets": [{
|
||||
"language": "powershell",
|
||||
"path": "./snippets/powershell.code-snippets"
|
||||
}]
|
||||
},
|
||||
"scripts": {
|
||||
"update-grammar": "node ../../build/npm/update-grammar.js PowerShell/EditorSyntax PowerShellSyntax.tmLanguage ./syntaxes/powershell.tmLanguage.json"
|
||||
}
|
||||
}
|
4
lib/vscode/extensions/powershell/package.nls.json
Normal file
4
lib/vscode/extensions/powershell/package.nls.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"displayName": "Powershell Language Basics",
|
||||
"description": "Provides snippets, syntax highlighting, bracket matching and folding in Powershell files."
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
{
|
||||
"Region Start": {
|
||||
"prefix": "#region",
|
||||
"body": [
|
||||
"#region $0"
|
||||
],
|
||||
"description": "Folding Region Start"
|
||||
},
|
||||
"Region End": {
|
||||
"prefix": "#endregion",
|
||||
"body": [
|
||||
"#endregion"
|
||||
],
|
||||
"description": "Folding Region End"
|
||||
}
|
||||
}
|
1007
lib/vscode/extensions/powershell/syntaxes/powershell.tmLanguage.json
Normal file
1007
lib/vscode/extensions/powershell/syntaxes/powershell.tmLanguage.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,3 @@
|
||||
<#
|
||||
.
|
||||
#>
|
@ -0,0 +1,43 @@
|
||||
# Copyright Microsoft Corporation
|
||||
|
||||
function Test-IsAdmin() {
|
||||
try {
|
||||
$identity = [Security.Principal.WindowsIdentity]::GetCurrent()
|
||||
$principal = New-Object Security.Principal.WindowsPrincipal -ArgumentList $identity
|
||||
return $principal.IsInRole( [Security.Principal.WindowsBuiltInRole]::Administrator )
|
||||
} catch {
|
||||
throw "Failed to determine if the current user has elevated privileges. The error was: '{0}'." -f $_
|
||||
}
|
||||
}
|
||||
|
||||
function Invoke-Environment()
|
||||
{
|
||||
param
|
||||
(
|
||||
[Parameter(Mandatory=1)][string]$Command
|
||||
)
|
||||
|
||||
foreach($_ in cmd /c "$Command 2>&1 & set") {
|
||||
if ($_ -match '^([^=]+)=(.*)') {
|
||||
[System.Environment]::SetEnvironmentVariable($matches[1], $matches[2])
|
||||
}
|
||||
}
|
||||
}
|
||||
Write-Host -Object 'Initializing Azure PowerShell environment...';
|
||||
|
||||
# PowerShell commands need elevation for dependencies installation and running tests
|
||||
if (!(Test-IsAdmin)){
|
||||
Write-Host -Object 'Please launch command under administrator account. It is needed for environment setting up and unit test.' -ForegroundColor Red;
|
||||
}
|
||||
|
||||
$env:AzurePSRoot = Split-Path -Parent -Path $env:AzurePSRoot;
|
||||
|
||||
if (Test-Path -Path "$env:ADXSDKProgramFiles\Microsoft Visual Studio 12.0") {
|
||||
$vsVersion="12.0"
|
||||
} else {
|
||||
$vsVersion="11.0"
|
||||
}
|
||||
|
||||
$setVSEnv = '"{0}\Microsoft Visual Studio {1}\VC\vcvarsall.bat" x64' -f $env:ADXSDKProgramFiles, $vsVersion;
|
||||
|
||||
Invoke-Environment -Command $setVSEnv;
|
@ -0,0 +1,35 @@
|
||||
[
|
||||
{
|
||||
"c": "<#",
|
||||
"t": "source.powershell comment.block.powershell punctuation.definition.comment.block.begin.powershell",
|
||||
"r": {
|
||||
"dark_plus": "comment: #6A9955",
|
||||
"light_plus": "comment: #008000",
|
||||
"dark_vs": "comment: #6A9955",
|
||||
"light_vs": "comment: #008000",
|
||||
"hc_black": "comment: #7CA668"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": " .",
|
||||
"t": "source.powershell comment.block.powershell",
|
||||
"r": {
|
||||
"dark_plus": "comment: #6A9955",
|
||||
"light_plus": "comment: #008000",
|
||||
"dark_vs": "comment: #6A9955",
|
||||
"light_vs": "comment: #008000",
|
||||
"hc_black": "comment: #7CA668"
|
||||
}
|
||||
},
|
||||
{
|
||||
"c": "#>",
|
||||
"t": "source.powershell comment.block.powershell punctuation.definition.comment.block.end.powershell",
|
||||
"r": {
|
||||
"dark_plus": "comment: #6A9955",
|
||||
"light_plus": "comment: #008000",
|
||||
"dark_vs": "comment: #6A9955",
|
||||
"light_vs": "comment: #008000",
|
||||
"hc_black": "comment: #7CA668"
|
||||
}
|
||||
}
|
||||
]
|
2895
lib/vscode/extensions/powershell/test/colorize-results/test_ps1.json
Normal file
2895
lib/vscode/extensions/powershell/test/colorize-results/test_ps1.json
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user