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
10 changes: 9 additions & 1 deletion PowerShell.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -340,12 +340,20 @@ contexts:
inside-unquoted-string:
- meta_include_prototype: false
- meta_scope: string.unquoted.powershell
- match: (?=[\s#|>;,]|$)
- match: $|(?=[\s#|>;,()}])
pop: 1
- match: \{
push: inside-unquoted-string-brace
- include: path-punctuation
- include: escape-sequences
- include: string-wildcards

inside-unquoted-string-brace:
- meta_include_prototype: false
- match: \}
pop: 1
- include: inside-unquoted-string

pop-end-of-command:
- include: line-continuations
- include: pop-eol
Expand Down
69 changes: 69 additions & 0 deletions tests/syntax_test_PowerShell.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1873,6 +1873,75 @@ $a3[1..2]
# ^ punctuation.definition.parameter.powershell
# ^^^^^^^^^^^^^^ string.unquoted.powershell - keyword

New-Object -TypeName System(Component)
# ^^^^^^^^^^ meta.function-call.powershell support.function.powershell
# @@@@@@@@@@ reference
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function-call.arguments.powershell
# ^^^^^^^^^ variable.parameter.option.powershell
# ^ punctuation.definition.parameter.powershell
# ^^^^^^ string.unquoted.powershell
# ^^^^^^^^^^^ - string
# @@@@@@@@@ reference

New-Object -TypeName System.Component)
# ^^^^^^^^^^ meta.function-call.powershell support.function.powershell
# @@@@@@@@@@ reference
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function-call.arguments.powershell
# ^^^^^^^^^ variable.parameter.option.powershell
# ^ punctuation.definition.parameter.powershell
# ^^^^^^^^^^^^^^^^ string.unquoted.powershell
# ^ - meta.function-call - string

(New-Object -TypeName SystemComponent).run()
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.group.powershell
# ^ punctuation.section.group.begin.powershell
# ^^^^^^^^^^ meta.function-call.powershell support.function.powershell
# @@@@@@@@@@ reference
# ^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function-call.arguments.powershell
# ^^^^^^^^^ variable.parameter.option.powershell
# ^ punctuation.definition.parameter.powershell
# ^^^^^^^^^^^^^^^ string.unquoted.powershell
# ^ punctuation.section.group.end.powershell
# ^ punctuation.accessor.dot.powershell
# ^^^ meta.function-call.powershell variable.function.powershell
# @@@ reference
# ^^ meta.function-call.arguments.powershell
# ^ punctuation.section.arguments.begin.powershell
# ^ punctuation.section.arguments.end.powershell

New-Object -TypeName System[Component]
# ^^^^^^^^^^ meta.function-call.powershell support.function.powershell
# @@@@@@@@@@ reference
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function-call.arguments.powershell
# ^^^^^^^^^ variable.parameter.option.powershell
# ^ punctuation.definition.parameter.powershell
# ^^^^^^^^^^^^^^^^^ string.unquoted.powershell

New-Object -TypeName System.Component]
# ^^^^^^^^^^ meta.function-call.powershell support.function.powershell
# @@@@@@@@@@ reference
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function-call.arguments.powershell
# ^^^^^^^^^ variable.parameter.option.powershell
# ^ punctuation.definition.parameter.powershell
# ^^^^^^^^^^^^^^^^^ string.unquoted.powershell

New-Object -TypeName System{Compon{ent}}
# ^^^^^^^^^^ meta.function-call.powershell support.function.powershell
# @@@@@@@@@@ reference
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function-call.arguments.powershell
# ^^^^^^^^^ variable.parameter.option.powershell
# ^ punctuation.definition.parameter.powershell
# ^^^^^^^^^^^^^^^^^^^ string.unquoted.powershell

New-Object -TypeName System.Component}
# ^^^^^^^^^^ meta.function-call.powershell support.function.powershell
# @@@@@@@@@@ reference
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.function-call.arguments.powershell
# ^^^^^^^^^ variable.parameter.option.powershell
# ^ punctuation.definition.parameter.powershell
# ^^^^^^^^^^^^^^^^ string.unquoted.powershell
# ^^ - meta.function-call - string

echo `"test`"
# ^^^^ meta.function-call.powershell variable.function.powershell
# @@@@ reference
Expand Down