Skip to content

Commit 8635da9

Browse files
committed
Fix for SublimeText#70 and minors
1 parent 3a225a0 commit 8635da9

File tree

3 files changed

+33
-9
lines changed

3 files changed

+33
-9
lines changed

Support/PowershellSyntax.tmLanguage

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -222,13 +222,6 @@
222222
<string>\)</string>
223223
<key>name</key>
224224
<string>meta.group.complex.subexpression.powershell</string>
225-
<key>patterns</key>
226-
<array>
227-
<dict>
228-
<key>include</key>
229-
<string>$self</string>
230-
</dict>
231-
</array>
232225
</dict>
233226
<dict>
234227
<key>match</key>
@@ -331,7 +324,7 @@
331324
</dict>
332325
</dict>
333326
<key>end</key>
334-
<string>(?&lt;=\))\]</string>
327+
<string>\]</string>
335328
<key>endCaptures</key>
336329
<dict>
337330
<key>0</key>

tests/pester/Syntax.Tests.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ Describe "Syntax highlighting" {
4949
$ignore = $true
5050
}
5151

52+
if (@('7>') -contains $psScope.Text) {
53+
# this is fine. It's more like a powershell parsing problem.
54+
$ignore = $true
55+
}
56+
57+
5258
# TODO: These are bugs
5359
if (@('Number', 'Redirection') -contains $psScope.Kind) {
5460
$ignore = $true
@@ -62,7 +68,7 @@ Describe "Syntax highlighting" {
6268
}
6369
}
6470
# TODO: These are bugs, make it 0
65-
$errorCounter | Should be @(0..2)
71+
$errorCounter | Should be 1
6672
}
6773

6874
It "produces same tokens for lower case" {

tests/samples/test-file.ps1

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,3 +427,28 @@ Get-things.ps1 -value @args
427427

428428
# array subexpression
429429
@(This $a is it. | "$(this-is | @($('yeah'| "" )) )")
430+
431+
# TODO: [minor] D:\dev\Find-String should not be treated as cmdlet name
432+
Import-Module D:\dev\Find-String
433+
434+
435+
function Get-EscapedPath
436+
{
437+
param(
438+
[Parameter(
439+
Position=0,
440+
Mandatory=$true
441+
ValueFromPipeline=$true,
442+
ValueFromPipelineByPropertyName=$true)
443+
]
444+
[string]$path
445+
)
446+
447+
process {
448+
if ($path.Contains(' '))
449+
{
450+
return '"' + $path + '"'
451+
}
452+
return $path
453+
}
454+
}

0 commit comments

Comments
 (0)