Version v2021.5.1 Semantic Textmate Scope is incorrect for negative numeric literals, when used as a parameter
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- powershell
- Bereich
- tooling
Rechercherichtung
Start by reproducing the issue with the PowerShell code in the report, focusing on negative numeric literals passed as parameters. Compare the TextMate scopes for negative and positive values, and verify that the affected parameter cases receive matching scopes without changing the reported non-parameter behavior.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
"editor.semanticHighlighting.enabled": true is on
System Details
System Details (Click to Expand)
System Details Output
### VSCode version: 1.56.2 054a9295330880ed74ceaedda236253b4f39a335 x64
### VSCode extensions:
adrieankhisbe.vscode-ndjson@0.100.0
ahebrank.yaml2json@0.0.3
alefragnani.Bookmarks@13.0.4
arcticicestudio.nord-visual-studio-code@0.15.1
bierner.docs-view@0.0.9
bungcip.better-toml@0.3.2
christian-kohler.path-intellisense@2.3.0
CoenraadS.bracket-pair-colorizer@1.0.61
CoenraadS.bracket-pair-colorizer-2@0.2.0
darkriszty.markdown-table-prettify@3.4.0
DavidAnson.vscode-markdownlint@0.41.1
donjayamanne.githistory@0.6.16
DotJoshJohnson.xml@2.5.1
eamodio.gitlens@11.4.1
eamodio.tsl-problem-matcher@0.4.0
Equinusocio.vsc-community-material-theme@1.4.2
Equinusocio.vsc-material-theme@33.2.0
equinusocio.vsc-material-theme-icons@1.2.2
esbenp.prettier-vscode@6.4.0
evan-buss.font-switcher@4.0.1
firefox-devtools.vscode-firefox-debug@2.9.4
formulahendry.code-runner@0.11.4
GitHub.github-vscode-theme@4.1.1
GitHub.vscode-pull-request-github@0.26.0
hbenl.vscode-test-explorer@2.20.2
icsharpcode.ilspy-vscode@0.10.0
juanmnl.vscode-theme-hydra@3.2.0
littlefoxteam.vscode-python-test-adapter@0.6.8
LouisWT.regexp-preview@0.1.5
matangover.mypy@0.2.0
mechatroner.rainbow-csv@1.8.1
medo64.code-point@1.7.5
ms-azure-devops.azure-pipelines@1.183.0
ms-dotnettools.csharp@1.23.12
ms-dotnettools.dotnet-interactive-vscode@1.0.2256020
ms-dotnettools.vscode-dotnet-runtime@1.1.0
ms-dotnettools.vscode-dotnet-sdk@0.5.0
ms-mssql.mssql@1.10.1
ms-python.python@2021.6.908196464-dev
ms-python.vscode-pylance@2021.6.1-pre.1
ms-toolsai.jupyter@2021.6.832593372
ms-vscode-remote.remote-wsl@0.56.4
ms-vscode.azure-account@0.9.8
ms-vscode.cpptools@1.4.0
ms-vscode.powershell@2021.5.1
ms-vscode.powershell-preview@2020.7.0
ms-vscode.test-adapter-converter@0.0.9
ms-vscode.vscode-typescript-tslint-plugin@1.3.3
msjsdiag.debugger-for-chrome@4.12.12
octref.vscode-json-transform@0.1.2
PKief.material-icon-theme@4.7.0
PowerQuery.vscode-powerquery@0.1.19
RandomFractalsInc.snippets-viewer@1.9.0
RandomFractalsInc.vscode-data-preview@2.3.0
redhat.vscode-commons@0.0.6
redhat.vscode-xml@0.16.1
redhat.vscode-yaml@0.19.2
RobbOwen.synthwave-vscode@0.1.8
rogalmic.bash-debug@0.3.9
rust-lang.rust@0.7.8
sallar.vscode-duotone-dark@0.3.3
samuelcolvin.jinjahtml@0.16.0
shakram02.bash-beautify@0.1.1
shd101wyy.markdown-preview-enhanced@0.5.18
stansw.vscode-odata@0.1.0
stuart.unique-window-colors@1.0.51
svipas.control-snippets@1.9.1
TylerLeonhardt.vscode-inline-values-powershell@0.0.5
TylerLeonhardt.vscode-pester-test-adapter@0.0.23
vadimcn.vscode-lldb@1.6.4
VisualStudioExptTeam.vscodeintellicode@1.2.14
vscode-icons-team.vscode-icons@11.4.0
webfreak.debug@0.25.0
wwm.better-align@1.1.6
yzhang.markdown-all-in-one@3.4.0
zhuangtongfa.material-theme@3.10.14
### PSES version: 2.3.0.0
### PowerShell version:
Name Value
---- -----
PSVersion 7.1.2
PSEdition Core
GitCommitId 7.1.2
OS Microsoft Windows 10.0.19041
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Issue Description
The Textmate scopes or token is wrong on negative numeric literals

Working behavior
Non-parameters, and positive numbers are okay

Expected Behaviour
To share similar tokens/scopes
To reproduce
It seems to occur when:
- it's a negative numeric literal (int, or decimal)
- it's a parameter
- the parameter type doesn't matter
Code used:
function DoNothing {
param(
[Parameter(Mandatory, Position = 0)]
[int]$Number
)
}
function DoMoreNothing {
param(
[Parameter(Mandatory, Position = 0)]
[string]$Text
)
}
$x = 6 ; $x
$x = -6
DoNothing -6
DoNothing 6
DoNothing -Number 6
DoNothing -Number -6
DoMoreNothing -Text 6
DoMoreNothing -Text -6
Actual Behavior

- Vorherrschende Sprache
- PowerShell
- Sterne
- 151
- Forks
- 55
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus PowerShell/EditorSyntax
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 55/100
PowerShell/EditorSyntax#224 · 2 Kommentare ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 48/100
PowerShell/EditorSyntax#222 · 2 Kommentare ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 55/100
PowerShell/EditorSyntax#221 · 2 Kommentare ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 45/100
PowerShell/EditorSyntax#220 · 2 Kommentare · 1 Reaktion ·
-
Issue-Bug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 48/100
PowerShell/EditorSyntax#219 · 2 Kommentare ·
Alle Issues in PowerShell/EditorSyntax
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
palladius/rails8-app-on-gcp#145 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
elastic/gradle-plugins#156 ·
-
area:workflow bug ready-for-agent
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
fil-donadoni/tolaria#4409 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
dotenvx/dotenv-vscode#139 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
Fission-AI/OpenSpec#1960 ·