This repository has been archived by the owner on Jun 2, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into move-to-editor-syntax
- Loading branch information
Showing
13 changed files
with
473 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Any grammar-related issues (ex: syntax highlight problems) should be made in the [PowerShell/EditorSyntax][PSES] project instead, since that is the backing grammar for this project. | ||
|
||
[PSES]:https://github.com/PowerShell/EditorSyntax |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
# PowerShell language support in Atom [![Build Status](https://travis-ci.org/jugglingnutcase/language-powershell.svg?branch=master)](https://travis-ci.org/jugglingnutcase/language-powershell) | ||
# PowerShell language support in Atom [![Build Status](https://travis-ci.org/jrsconfitto/language-powershell.svg?branch=master)](https://travis-ci.org/jrsconfitto/language-powershell) | ||
|
||
This package provides [PowerShell](https://msdn.microsoft.com/en-us/mt173057.aspx) language support in the [Atom editor](https://atom.io) by leveraging the [PowerShell syntax](https://github.com/PowerShell/EditorSyntax) from Microsoft. | ||
This package provides [PowerShell](https://msdn.microsoft.com/en-us/mt173057.aspx) language support in the [Atom editor](https://atom.io) by leveraging the [PowerShell syntax][ES] from Microsoft. | ||
|
||
## Issues | ||
|
||
If you discover any issues with the way the syntax is highlighted, please open an issue against the [PowerShell/EditorSyntax][ES] repository instead of this one, since this package is based on that grammar. | ||
|
||
Any issues that aren't related to the grammar are fair game here, though! Start one [here](https://github.com/jugglingnutcase/language-powershell/issues/new). | ||
|
||
[ES]:https://github.com/PowerShell/EditorSyntax |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
var fs = require('fs'), | ||
plist = require('plist'), | ||
CSON = require('cson'); | ||
var fs = require("fs"), | ||
plist = require("plist"), | ||
CSON = require("cson"); | ||
|
||
// Read grammar from plist | ||
var psGrammarPlist = fs.readFileSync('vendor/EditorSyntax/PowerShellSyntax.tmLanguage', 'utf8'); | ||
var psGrammarPlist = fs.readFileSync( | ||
"vendor/EditorSyntax/PowershellSyntax.tmLanguage", | ||
"utf8" | ||
); | ||
var grammar = plist.parse(psGrammarPlist); | ||
|
||
// Write out grammar as CSON | ||
var csonGrammar = CSON.stringify(filterObject(grammar)); | ||
fs.writeFileSync('grammars/powershell.cson', csonGrammar, 'utf8'); | ||
fs.writeFileSync("grammars/powershell.cson", csonGrammar, "utf8"); | ||
|
||
// Helper function | ||
// References: https://github.com/atom/apm/blob/c0d657af13a0da4acda6fd4be39eddded7aac1e3/src/package-converter.coffee#L73-75 | ||
function filterObject(obj) { | ||
delete obj.uuid | ||
delete obj.keyEquivalent | ||
return obj | ||
delete obj.uuid; | ||
delete obj.keyEquivalent; | ||
return obj; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Set-PSReadLineKeyHandler -Chord 'Ctrl+p' -Function PreviousHistory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
function Test-Highlighting { | ||
Get-Command -Name Get-Alias -CommandType Function -ErrorAction SilentlyContinue | ||
} | ||
# Test thanks to @kborowinski: https://github.com/PowerShell/EditorSyntax/pull/93 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Function Test-Function () { | ||
Write-Host "Hi!" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
foreach($foo in $myArray) | ||
{ | ||
Write-Host "Value $foo" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Param ( | ||
[switch] $arg1 | ||
[switch] $arg2 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
$ProcessesWithoutParents = @() | ||
$ProcessesByParent = @{} | ||
foreach ($Pair in $ProcessesById.GetEnumerator()) { | ||
$Process = $Pair.Value | ||
if (($Process.ParentProcessId -eq 0) -or !$ProcessesById.ContainsKey($Process.ParentProcessId)) { | ||
$ProcessesWithoutParents += $Process | ||
continue | ||
} | ||
} |
Oops, something went wrong.