PowerShell / EditorSyntax

PowerShell syntax highlighting for editors (VS Code, Atom, SublimeText, TextMate, etc.) and GitHub!
MIT License
133 stars 45 forks source link

Variable index scoped as type. #92

Closed omniomi closed 6 years ago

omniomi commented 6 years ago

Environment

Issue Description

indexes [...] Numbers, strings, and variable names are all getting coloured the same as types. I don't know what other basic types I'm missing, but I'm guessing they would behave the same.

$Array[$Variable] = $OtherArray[$Variable - 1] + $HashTable['spanakopita']

Screenshots

indexes

Expected Behavior

An index should scope whatever it contains correctly. Ie, an int as an int.

Code Samples

$Array[$Variable]
$OtherArray[$Variable - 1]
$HashTable['spanakopita']
$Array[0]

Reported by @ThubLives on issue #26.

omniomi commented 6 years ago

This is caused by the fact that none of the variable definitions contain patterns to match indices. Will cleanup repository -> variable and account for an index.

omniomi commented 6 years ago

Actually, this issue has not been introduced yet. It's an issue in https://github.com/omniomi/EditorSyntax/tree/fix-attributes - will fix before submitting the PR.