Skip to content

Commit 04f8b43

Browse files
committed
Fix functions not popping fast enough
1 parent 2f3144f commit 04f8b43

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

PowerShell.sublime-syntax

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ contexts:
403403
inside-function-body:
404404
- match: \}
405405
scope: punctuation.section.block.end.powershell
406-
pop: 1
406+
pop: 2
407407

408408
- match: \b(?i:(?:Dynamic)?Param){{kebab_break}}
409409
scope: keyword.declaration.parameter.powershell # This scope is not standard

Tests/syntax_test_Class.ps1

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,12 @@ class TypeName
103103
# ^^ variable.other.readwrite.powershell
104104
# ^ punctuation.definition.variable.powershell
105105
}
106-
106+
# ^ - meta.function
107107
# Static method
108108
# <- punctuation.definition.comment
109109
# ^^^^^^^^^^^^^ comment.line
110110
static [void] MemberMethod1([hashtable] $h) {
111111
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.class.powershell
112-
#^^^ meta.function.powershell
113112
# ^^^^^^ storage.modifier.powershell
114113
# ^ punctuation.section.brackets.begin.powershell
115114
# ^^^^ storage.type.powershell
@@ -142,7 +141,6 @@ class TypeName
142141
# ^^^^^^^^^^^^^^^ comment.line
143142
[int] MemberMethod2([int] $i) {
144143
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.class.powershell
145-
#^^^ meta.function.powershell
146144
# ^ punctuation.section.brackets.begin.powershell
147145
# ^^^ storage.type.powershell
148146
# ^ punctuation.section.brackets.end.powershell

Tests/syntax_test_PowerShell.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,6 +1021,7 @@ functioN MyFunction{}
10211021
# @@@@@@@@@@ definition
10221022
# ^ punctuation.section.block.begin.powershell
10231023
# ^ punctuation.section.block.end.powershell
1024+
# ^ - meta
10241025
function My-Function {}
10251026
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.powershell
10261027
#^^^^^^^ keyword.declaration.function.powershell
@@ -1276,7 +1277,8 @@ class Vehicle {
12761277
# ^ punctuation.section.block.begin.powershell
12771278
# ^ punctuation.section.block.end.powershell
12781279
Vehicle([string]$Owner) {
1279-
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.class.powershell meta.function.powershell
1280+
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.class.powershell
1281+
# ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.powershell
12801282
# ^^^^^^^ entity.name.function.powershell
12811283
# @@@@@@@ definition
12821284
# ^ punctuation.section.parameters.begin.powershell
@@ -1335,7 +1337,6 @@ class Vehicle {
13351337

13361338
static [System.Array] GetAvailableColors() {
13371339
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.class.powershell
1338-
#^^^ meta.function.powershell
13391340
# ^^^^^^ storage.modifier.powershell
13401341
# ^ punctuation.section.brackets.begin.powershell
13411342
# ^^^^^^^ meta.generic-name.powershell

0 commit comments

Comments
 (0)