Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix else indentation #180

Merged
merged 2 commits into from
Dec 22, 2024
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
2 changes: 2 additions & 0 deletions Indentation.tmPreferences
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
<dict>
<key>unIndentedLinePattern</key>
<string>"@</string>
<key>decreaseIndentPattern</key>
<string>^(.*\*/)?\s*\}[;\s]*(?:$|else\b|elseif\b)</string>
</dict>
</dict>
</plist>
2 changes: 1 addition & 1 deletion Tests/syntax_test_PowerShell.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@
# ^^ constant.numeric.float
1.d
# ^^^ constant.numeric.float
1.lGB

Check failure on line 478 in Tests/syntax_test_PowerShell.ps1

View workflow job for this annotation

GitHub Actions / Syntax Tests (4102)

[constant.numeric.float - unclear whether float or int] does not match scope [source.powershell]

Check failure on line 478 in Tests/syntax_test_PowerShell.ps1

View workflow job for this annotation

GitHub Actions / Syntax Tests (4102)

[keyword.other.unit] does not match scope [source.powershell]

Check failure on line 478 in Tests/syntax_test_PowerShell.ps1

View workflow job for this annotation

GitHub Actions / Syntax Tests (4102)

[keyword.other.unit] does not match scope [source.powershell]

Check failure on line 478 in Tests/syntax_test_PowerShell.ps1

View workflow job for this annotation

GitHub Actions / Syntax Tests (4102)

[constant.numeric.float - unclear whether float or int] does not match scope [source.powershell]

Check failure on line 478 in Tests/syntax_test_PowerShell.ps1

View workflow job for this annotation

GitHub Actions / Syntax Tests (4102)

[keyword.other.unit] does not match scope [source.powershell]

Check failure on line 478 in Tests/syntax_test_PowerShell.ps1

View workflow job for this annotation

GitHub Actions / Syntax Tests (4102)

[keyword.other.unit] does not match scope [source.powershell]
# ^^^ constant.numeric.float - unclear whether float or int
# ^^ keyword.other.unit
1.dGB
Expand Down Expand Up @@ -522,7 +522,7 @@
# ^^ constant.numeric.integer
# ^^^ constant.numeric.float
# ^ keyword.operator
-10.002L

Check failure on line 525 in Tests/syntax_test_PowerShell.ps1

View workflow job for this annotation

GitHub Actions / Syntax Tests (4102)

[constant.numeric.float - unclear whether float or int] does not match scope [source.powershell]

Check failure on line 525 in Tests/syntax_test_PowerShell.ps1

View workflow job for this annotation

GitHub Actions / Syntax Tests (4102)

[constant.numeric.float - unclear whether float or int] does not match scope [source.powershell]
# ^ keyword.operator.unary
# ^^^^^^^ constant.numeric.float - unclear whether float or int
$x..5.40D
Expand Down Expand Up @@ -869,7 +869,7 @@
FUNCTION MyFunction2 {}
# <- storage.type
# ^^^^^^^^^^^ entity.name.function
# @@@@@@@@@@ definition
# @@@@@@@@@@@ definition
# ^ punctuation.section.braces.begin
# ^ punctuation.section.braces.end
function New-File { }
Expand Down Expand Up @@ -989,7 +989,7 @@
# ^ keyword.operator.assignment
# ^ constant.numeric.integer
# ^ punctuation.separator
SupportsPaging,

Check failure on line 992 in Tests/syntax_test_PowerShell.ps1

View workflow job for this annotation

GitHub Actions / Syntax Tests (4102)

[variable.parameter.attribute] does not match scope [source.powershell meta.block.powershell meta.group.powershell meta.attribute.powershell]

Check failure on line 992 in Tests/syntax_test_PowerShell.ps1

View workflow job for this annotation

GitHub Actions / Syntax Tests (4102)

[variable.parameter.attribute] does not match scope [source.powershell meta.block.powershell meta.group.powershell meta.attribute.powershell]

Check failure on line 992 in Tests/syntax_test_PowerShell.ps1

View workflow job for this annotation

GitHub Actions / Syntax Tests (4102)

[variable.parameter.attribute] does not match scope [source.powershell meta.block.powershell meta.group.powershell meta.attribute.powershell]

Check failure on line 992 in Tests/syntax_test_PowerShell.ps1

View workflow job for this annotation

GitHub Actions / Syntax Tests (4102)

[variable.parameter.attribute] does not match scope [source.powershell meta.block.powershell meta.group.powershell meta.attribute.powershell]

Check failure on line 992 in Tests/syntax_test_PowerShell.ps1

View workflow job for this annotation

GitHub Actions / Syntax Tests (4102)

[variable.parameter.attribute] does not match scope [source.powershell meta.block.powershell meta.group.powershell meta.attribute.powershell]

Check failure on line 992 in Tests/syntax_test_PowerShell.ps1

View workflow job for this annotation

GitHub Actions / Syntax Tests (4102)

[variable.parameter.attribute] does not match scope [source.powershell meta.block.powershell meta.group.powershell meta.attribute.powershell]

Check failure on line 992 in Tests/syntax_test_PowerShell.ps1

View workflow job for this annotation

GitHub Actions / Syntax Tests (4102)

[variable.parameter.attribute] does not match scope [source.powershell meta.block.powershell meta.group.powershell meta.attribute.powershell]

Check failure on line 992 in Tests/syntax_test_PowerShell.ps1

View workflow job for this annotation

GitHub Actions / Syntax Tests (4102)

[variable.parameter.attribute] does not match scope [source.powershell meta.block.powershell meta.group.powershell meta.attribute.powershell]

Check failure on line 992 in Tests/syntax_test_PowerShell.ps1

View workflow job for this annotation

GitHub Actions / Syntax Tests (4102)

[variable.parameter.attribute] does not match scope [source.powershell meta.block.powershell meta.group.powershell meta.attribute.powershell]

Check failure on line 992 in Tests/syntax_test_PowerShell.ps1

View workflow job for this annotation

GitHub Actions / Syntax Tests (4102)

[variable.parameter.attribute] does not match scope [source.powershell meta.block.powershell meta.group.powershell meta.attribute.powershell]

Check failure on line 992 in Tests/syntax_test_PowerShell.ps1

View workflow job for this annotation

GitHub Actions / Syntax Tests (4102)

[variable.parameter.attribute] does not match scope [source.powershell meta.block.powershell meta.group.powershell meta.attribute.powershell]

Check failure on line 992 in Tests/syntax_test_PowerShell.ps1

View workflow job for this annotation

GitHub Actions / Syntax Tests (4102)

[variable.parameter.attribute] does not match scope [source.powershell meta.block.powershell meta.group.powershell meta.attribute.powershell]
#^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.attribute
# ^^^^^^^^^^^^^^ variable.parameter.attribute
# ^ punctuation.separator
Expand Down
8 changes: 8 additions & 0 deletions Tests/syntax_test_reindent.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,11 @@ Function Get-ForegroundWindow {
}

Get-ForegroundWindow

if ($true) {
Write-Host 'test'
} elseif ($false) {
Write-Host 'test2'
} else {
Write-Host 'test3'
}
Loading