Inhaltsverzeichnis
VSCode Extension Checklist
Specific checks for VSCode Extensions with pas2js.
This checklist supplements the Core Checklist for VSCode extensions.
Required Checks
Activation Events
[ ] Activation Events are minimal and correct [ ] No "activate on *" unless justified [ ] Events match actual functionality
Example package.json:
{ "activationEvents": [ "onCommand:wvds.build.run", "onLanguage:pascal", "workspaceContains:**/*.lpr" ] }
Performance
[ ] No long-running operations on Extension Host Thread [ ] Async work is cancellable (Cancellation Token) [ ] Progress reporting for long operations
Example: Cancellable Operation:
procedure LongOperation(AToken: TCancellationToken); begin while not Finished do begin if AToken.IsCancellationRequested then begin Logger.Info(rsOperationCancelled); Exit; end; ProcessNextItem; end; end;
Commands
[ ] Commands have consistent IDs [ ] All Commands have title and category [ ] Command grouping is logical
Naming Convention:
wvds.<domain>.<action> └── wvds.build.run └── wvds.build.clean └── wvds.projects.create
Settings
[ ] All Settings in contributes.configuration [ ] Settings are documented (description) [ ] Settings have secure defaults [ ] Settings are validated
Example:
{ "contributes": { "configuration": { "title": "WvdS Toolchain", "properties": { "wvds.toolchain.fpcPath": { "type": "string", "default": "", "description": "Path to fpc.exe. Leave empty for auto-detection." } } } } }
Security
[ ] External tool calls validated/sanitized [ ] Workspace paths treated as untrusted [ ] No Command Injection possible [ ] shell: false for Spawn calls
Example: Secure Tool Call:
(* FORBIDDEN - Command Injection possible *) Exec('fpc ' + UserInput); (* CORRECT - Secure alternative *) var Options: TSpawnOptions; begin Options.shell := False; Options.cwd := ValidatedPath; Spawn('fpc', ['-O2', ValidatedInput], Options); end;
Cross-Platform
[ ] Paths are cross-platform safe [ ] Encodings considered (UTF-8) [ ] Line Endings considered [ ] Path separators correct (use PathJoin)
package.json Metadata
[ ] publisher set [ ] name correct (lowercase, hyphens) [ ] version follows SemVer [ ] license specified [ ] repository linked [ ] engines.vscode set to minimum version
Marketplace Assets
[ ] README.md present and current [ ] CHANGELOG.md with version history [ ] Icon present (128x128 PNG) [ ] Screenshots for complex features
pas2js-Specific Checks
Compilation
[ ] Compiles without errors with pas2js [ ] No pas2js-incompatible features used [ ] No class var (use Unit-Level Variable instead) [ ] No Int64 (use Integer instead) [ ] No // comments in asm blocks
Entry Point Pattern
[ ] extension_main.pas present [ ] Activate/Deactivate exported [ ] Initialization block calls ExportActivateDeactivate
Template:
unit extension_main; {$mode objfpc}{$H+} interface uses JS, VSCode.API, WvdS.VSCode.ExtensionExports; procedure Activate(AContext: TExtensionContext); procedure Deactivate; implementation procedure Activate(AContext: TExtensionContext); begin (* Initialization *) end; procedure Deactivate; begin (* Cleanup *) end; initialization ExportActivateDeactivate(@Activate, @Deactivate); end.
SSOT for VSCode APIs
[ ] VSCode APIs via ~/sources/common/web/vscode/
[ ] No direct require('vscode') in Extensions
[ ] WvdS.VSCode.* Wrapper used
Recommended Checks
[ ] Progress Reporting for operations > 1s [ ] Cancellation Tokens implemented [ ] Debouncing for File Watching [ ] Extension size minimized [ ] No unnecessary binaries/assets
Optional Checks
[ ] Smoke Tests (Activation + Command) [ ] Offline mode when Remote Services used [ ] Telemetry documented (or none)
VSIX Creation
Build Process
# 1. Compile Pascal to JavaScript pas2js @../../common/wvds_common.pas2js.cfg @build.cfg pas/extension_main.pas # 2. Package VSIX vsce package --no-dependencies # 3. Validate vsce ls
Pre-VSIX Creation Checks
[ ] dist/extension_main.js present [ ] package.json version incremented [ ] CHANGELOG.md updated [ ] README.md current [ ] No debug artifacts included [ ] .vscodeignore correctly configured
Quick Checklist for Copying
Review Checklist (VSCode Extension): Required: - [ ] Minimal Activation Events - [ ] No blocking operations - [ ] Commands with IDs, titles, categories - [ ] Settings documented and validated - [ ] Tool calls sanitized (shell: false) - [ ] Cross-Platform safe (paths, encodings) - [ ] package.json Metadata complete pas2js: - [ ] Compiles without errors - [ ] No pas2js-incompatible features - [ ] Entry Point Pattern followed - [ ] SSOT for VSCode APIs Assets: - [ ] README.md present - [ ] CHANGELOG.md current - [ ] Icon present
See Also
Zuletzt geändert: on 2026/01/29 at 10:25 PM