Skip to content

Commit 676adfe

Browse files
committed
Shunt C# embed to its own test file
So we can be more permissive and hopefully keep older ST versions
1 parent cb1f727 commit 676adfe

File tree

2 files changed

+25
-27
lines changed

2 files changed

+25
-27
lines changed

Tests/syntax_test_Add-Type.ps1

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# SYNTAX TEST "Packages/PowerShell/PowerShell.sublime-syntax"
2+
3+
4+
Add-Type -Language CSharp @"
5+
# ^^^^^^^^ support.function.powershell
6+
# ^^^^^^^^^ variable.parameter.option.powershell
7+
# ^ punctuation.definition.parameter.powershell
8+
# ^^ meta.string.interpolated.powershell string.quoted.double.powershell punctuation.definition.string.begin.powershell
9+
using System;
10+
#^^^^^^^^^^^^^^^^ meta.string.interpolated.powershell string.quoted.double.powershell source.cs.embedded
11+
# ^^^^^ keyword.control.import.cs
12+
# ^^^^^^ meta.path.cs
13+
# ^ punctuation.terminator.statement.cs
14+
using System.Runtime.InteropServices;
15+
public class ClassGetForegroundWindow {
16+
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.string.interpolated.powershell string.quoted.double.powershell source.cs.embedded
17+
# ^^^^^^ storage.modifier.access.cs
18+
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.class.cs
19+
# ^^^^^ keyword.declaration.class.cs
20+
# ^^^^^^^^^^^^^^^^^^^^^^^^ entity.name.class.cs
21+
# ^ meta.class.body.cs meta.block.cs punctuation.section.block.begin.cs
22+
[DllImport("user32.dll")]
23+
public static extern IntPtr GetForegroundWindow();
24+
}
25+
"@

Tests/syntax_test_PowerShell.ps1

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1744,30 +1744,3 @@ function get-number {}
17441744
#^^^^^^^^^ keyword.other.region.end.powershell
17451745
#<- comment.line
17461746
# ^ meta.fold.end
1747-
1748-
Add-Type -Language CSharp @"
1749-
# ^^^^^^^^ support.function.powershell
1750-
# ^^^^^^^^^ variable.parameter.option.powershell
1751-
# ^ punctuation.definition.parameter.powershell
1752-
# ^^ meta.string.interpolated.powershell string.quoted.double.powershell punctuation.definition.string.begin.powershell
1753-
using System;
1754-
#^^^^^^^^^^^^^^^^ meta.string.interpolated.powershell string.quoted.double.powershell source.cs.embedded
1755-
# ^^^^^ keyword.control.import.cs
1756-
# ^^^^^^ meta.path.cs
1757-
# ^ punctuation.terminator.statement.cs
1758-
using System.Runtime.InteropServices;
1759-
public class ClassGetForegroundWindow {
1760-
#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.string.interpolated.powershell string.quoted.double.powershell source.cs.embedded
1761-
# ^^^^^^ storage.modifier.access.cs
1762-
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.class.cs
1763-
# ^^^^^ keyword.declaration.class.cs
1764-
# ^^^^^^^^^^^^^^^^^^^^^^^^ entity.name.class.cs
1765-
# @@@@@@@@@@@@@@@@@@@@@@@@ global-definition
1766-
# @@@@@@@@@@@@@@@@@@@@@@@@ local-definition
1767-
# ^ meta.class.body.cs meta.block.cs punctuation.section.block.begin.cs
1768-
[DllImport("user32.dll")]
1769-
public static extern IntPtr GetForegroundWindow();
1770-
# @@@@@@@@@@@@@@@@@@@ global-definition
1771-
# @@@@@@@@@@@@@@@@@@@ local-definition " GetForegroundWindow"
1772-
}
1773-
"@

0 commit comments

Comments
 (0)