Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions PowerShell.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ first_line_match: |-

contexts:
prototype:
- include: regions
- include: comments

main:
Expand Down Expand Up @@ -76,7 +77,6 @@ contexts:
expressions-without-commands:
# Meta
- include: labels
- include: regions
- include: requires-directives

- include: escape-sequences
Expand Down Expand Up @@ -580,7 +580,7 @@ contexts:
- meta_scope: meta.block.parameters.powershell
- match: \)
scope: punctuation.section.block.end.powershell
pop: 1
pop: 2
- include: comma-separators
- include: attributes
- include: types-without-members
Expand Down
54 changes: 54 additions & 0 deletions tests/syntax_test_PowerShell.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2370,6 +2370,8 @@ $a3[1..2]
# ^^^^ meta.toc-list entity.name.section
# @@@@ local-definition
# ^ meta.fold.begin
Do-Stuff
# @@@@@@@@ reference
#endregion (More comments)
#<- punctuation.definition.comment.powershell
#^^^^^^^^^ keyword.other.region.end.powershell
Expand All @@ -2386,3 +2388,55 @@ $a3[1..2]
#^^^^^^^^^ keyword.other.region.end.powershell
#<- comment.line
# ^ meta.fold.end

function Process-DeploymentConfig {
# @@@@@@@@@@@@@@@@@@@@@@@@ definition
[CmdletBinding()]
param (
[Parameter(Mandatory=$true)]
[string]$ConfigJson,

[Parameter(Mandatory=$true)]
[hashtable]PathVariables
)

#region PathHelper
# ^^^^^^^^^^^^^^^^^^^ comment.line.powershell
# ^ punctuation.definition.comment
# ^^^^^^ keyword.other.region.begin
# ^^^^^^^^^^ meta.toc-list entity.name.section
# @@@@@@@@@@ local-definition
# ^ meta.fold.begin

function Resolve-ConfigPath {
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function.powershell meta.function.powershell
# ^^^^^^^^ keyword.declaration.function.powershell
# ^^^^^^^^^^^^^^^^^^ entity.name.function.powershell
# @@@@@@@@@@@@@@@@@@ definition
# ^ punctuation.section.block.begin.powershell
[CmdletBinding()]
param (
[Parameter(Mandatory=$true)]
[string]$Path,

[Parameter(Mandatory=$true)]
[hashtable]$PathVariables
)

$Private:ResolvedPath = $Path
foreach ($key in $PathVariables.Keys) {
$ResolvedPath = $ResolvedPath.Replace($key, $PathVariables[$key])
# @@@@@@@ reference
}
return $ResolvedPath
}
#endregion
# ^^^^^^^^^^^ comment.line.powershell
# ^ punctuation.definition.comment.powershell
# ^^^^^^^^^ keyword.other.region.end.powershell
# ^ meta.fold.end


Resolve-ConfigPath -Path "Foo" -PathVariables $PathVariables
# @@@@@@@@@@@@@@@@@@ reference
}