sub members (properties/methods) of variables appear different behind an array reference

Ouverte
#127 6 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
35/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
À l'abandon
Stack technique
powershell
Domaine
tooling

Piste de recherche

Reproduce the three PowerShell expressions in VS Code and use the mentioned Inspect TM Scopes command to compare their scopes. Trace the syntax-highlighting grammar or entry point that handles property access through array references and parenthesized expressions. Done means all equivalent property accesses receive the intended property scope rather than the default unscoped color.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

bug
Environment
  • Editor and Version: VS Code: 1.25.1
  • Your primary theme: Dark+ (with corrections for punctuation inside subexpressions inside strings)
Issue Description

Shouldn't both of these appear equivalent? These are all just accessing a property of an object.

$dir.Extension

$dir[0].Extension

($dir).Extension

obviously there could be a complete expression inside the brackets.

image
(image doesn't contain the third example line)

Expected Behavior

I would have expected the properties to both be shown in the same dull yellow, but only the first one is, the others are instead white, the default when no scope match occurs.

Using VS Code's Inspect TM Scopes, the first line, results in 'entity.name.function.invocation.powershell' and 'source.powershell', where as the second only has 'source.powershell'.

Fortunately ${dir}.Extension appears correct, but brings up a different issue.

Langage dominant
PowerShell
Étoiles
151
Forks
55
Métriques de merge des PR
Aucune PR mergée en 30 j

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de PowerShell/EditorSyntax

Toutes les issues de PowerShell/EditorSyntax

Issues similaires

Plus d'issues DevTools

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.