Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Split commands.ts by topic

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

Maintainer thường phản hồi trong vòng 2 ngày

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

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript, vscode
Lĩnh vực
developer-experience

Hướng nghiên cứu

Start with src/commands.ts and the existing topic-split tests, including commands.netcheck.test.ts and commands.openWorkspace.test.ts; compare their organization with the command handlers. Review src/command/ before moving or renaming it, and identify the shared plumbing named in the proposal. Done means topic modules match the test split, registration delegates to them, and behavior and telemetry span threading remain unchanged.

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

Mô tả

Improvement tech-debt vs-code

src/commands.ts is 1,820 lines. One Commands class holds every command palette command, plus the helpers behind them. Its tests are already split by topic (commands.netcheck.test.ts, commands.openWorkspace.test.ts, …), but the source isn't.

Topics currently mixed into the class

  • Auth and deployments: login, logout, switchDeployment, manageCredentials, askSignOutCli, welcome/logout messages
  • Diagnostics: speedTest, netcheck, pingWorkspace, supportBundle (+ path prompt and consent), exportTelemetry, viewLogs
  • SSH config: openSshConfig, pickSshConfigPath, connectedSshConfigPath, applyRecommendedSettings
  • Opening workspaces: open, openFromSidebar, openWorkspaceFromSidebar, openDevContainer, pickWorkspace, openWorkspace, toWorkspaceAuthority, recentlyOpened, reusableAuthority, multi-window notification
  • Workspace actions: createWorkspace, updateWorkspace, navigateToWorkspace, navigateToWorkspaceSettings, openWorkspaceInDashboard, openAppStatus

Proposal

  1. Move each topic into a src/commands/ module that matches the existing test split. The shared plumbing (resolveClientAndWorkspace, resolveCliEnv, requireExtensionBaseUrl) goes in one place they all import.
  2. Keep command registration thin, so each handler delegates to its topic module.
  3. Rename or merge src/command/ first, because command/ (process exec) next to commands/ (VS Code commands) is confusing. diagnosticFlow.ts fits cli/, and exec.ts is generic process execution.

Non-goals: no behavior changes and no new abstractions. Move methods by topic and keep telemetry span threading as is. Related: #769 (command test coverage), #1066 (same split for remote.ts).

Filed by Claude Code for @EhabY.

Ngôn ngữ chính
TypeScript
Star
132
Fork
48
Merge trung bình
2 ngày 15 phút
Pull request đã merge (30 ngày)
17

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

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 coder/vscode-coder

Tất cả issue của coder/vscode-coder

Issue tương tự

Thêm issue về TypeScript

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.