Highlight parameter names after function invocation

Đang mở
#76 3 bình luận 2 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
powershell
Lĩnh vực
tooling

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
PowerShell
Star
151
Fork
55
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của PowerShell/EditorSyntax

Tất cả issue của PowerShell/EditorSyntax

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.