PowerShell / PowerShell/PSScriptAnalyzer

Implementing interface in PowerShell class does not warn about non-implemented interface members

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

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

Area - Rules Issue - Enhancement Issue - New Rule
Ngôn ngữ chính
C#
Star
2.2k
Fork
414
Merge trung bình
13 giờ 1 phút
Pull request đã merge (30 ngày)
2

Mô tả

System Details

System Details Output

### VSCode version: 1.47.3 91899dcef7b8110878ea59626991a18c8a6a1b3e x64

### VSCode extensions:
DavidAnson.vscode-markdownlint@0.36.2
eamodio.gitlens@10.2.2
Fudge.auto-using@0.7.15
jchannon.csharpextensions@1.3.1
k--kato.docomment@0.1.17
mhutchie.git-graph@1.25.0
ms-azuretools.vscode-docker@1.4.1
ms-dotnettools.csharp@1.22.1
ms-vscode-remote.remote-wsl@0.44.4
ms-vscode.cpptools@0.29.0
ms-vscode.powershell@2020.6.0
ms-vscode.powershell-preview@2020.7.0
redhat.vscode-xml@0.13.0
streetsidesoftware.code-spell-checker@1.9.0
zhuangtongfa.material-theme@3.8.5


### PSES version: 2.3.0.0

### PowerShell version:

Name                           Value
----                           -----
PSVersion                      7.1.0-preview.5
PSEdition                      Core
GitCommitId                    7.1.0-preview.5
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

PowerShell class implementing an interface does not create an error if required interface members are not present. There is also not a code action to implement interface.

using namespace System.Management.Automation

class test : IArgumentCompleter
{

}
Expected Behaviour

VS code warns about non-implemented interface members like C#. Code action to implement interface.

Actual Behaviour

VS code does not warn about non-implemented interface members or show code action to resolve.

image

Attached Logs

Follow the instructions in the troubleshooting docs
about capturing and sending logs.

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.

Hướng nghiên cứu

Bắt đầu với ví dụ về lớp PowerShell triển khai IArgumentCompleter và xem lại cách PSScriptAnalyzer báo cáo các thành viên giao diện còn thiếu. Sử dụng tài liệu khắc phục sự cố nếu cần nhật ký chẩn đoán. Công việc được xem là hoàn tất khi trình soạn thảo cảnh báo về các thành viên giao diện chưa được triển khai và cung cấp một code action để triển khai chúng.

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

Đánh giá

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

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.