Highlight parameter names after function invocation

Aperta
#76 3 commenti 2 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
powershell
Ambito
tooling

Direzione di ricerca

Start in powershell.tmLanguage.json and inspect the existing rules for operators, numeric constants, and command arguments. Try the examples from the issue, including Get-ChildItem parameters and switch -Regex, while checking that negative integers retain their current highlighting. Done means parameter names such as Path, Recurse, and Regex are highlighted without overriding operator or numeric scopes.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

Given Get-ChildItem -Path . -Recurse I cannot find a way to highlight "Path" and "Recurse". Currently I've only managed to highlight the -. The same goes for say "regex" in switch -Regex () {}.

It's gross but surly something like \\s\\-(?!(?i:[ic]?(?:eq|ne|gt|lt|ge|le|not|isnot|is|f|as|like|notmatch|match|notcontains|contains|in|and|or|xor|join|split|band|bor|bnot|bxor|replace))\\s)\\w+ would cover it? Provided it didn't step on constant.numeric and override negative integer highlighting.

Playing around on my own computer and adding this to powershell.tmLanguage.json:

{
    "match": "\\s\\-(?!(?i:[ic]?(?:eq|ne|gt|lt|ge|le|not|isnot|is|f|as|like|notmatch|match|notcontains|contains|in|and|or|xor|join|split|band|bor|bnot|bxor|replace))\\s)\\w+",
    "name": "variable.parameter.powershell"
},

I get the desired result although there may be edge cases I am not considering...

operators
commands

Lingua principale
PowerShell
Stelle
151
Fork
55
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PowerShell/EditorSyntax

Tutte le issue di PowerShell/EditorSyntax

Issue simili

Altre issue su DevTools

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.