- Follow the existing code style: Use single quotes, semicolons, and 2-space indentation. See
.eslintrc.base.jsonfor detailed linting rules. - TypeScript: Use modern TypeScript features. Prefer explicit types where clarity is needed, but do not over-annotate.
- React/JSX: Webviews use React-style JSX with custom factories (
vscpp,vscppf). - Strictness: Some strictness is disabled in
tsconfig.base.json(e.g.,strictNullChecks: false), but new code should avoid unsafe patterns. - Testing: Place tests under
src/test. Do not include test code in production files. - Localization: Use
%key%syntax for strings that require localization. Seepackage.nls.json. - Regular Expressions: Use named capture groups for clarity when working with complex regex patterns.
- VS Code API: Use the official VS Code API for all extension points. Register commands, views, and menus via
package.json. - Configuration: All user-facing settings must be declared in
package.jsonundercontributes.configuration. - Activation Events: Only add new activation events if absolutely necessary.
- Webviews: Place webview code in the
webviews/directory. Use the sharedcommon/code where possible. - Commands: Register new commands in
package.jsonand implement them insrc/commands.tsor a relevant module. - Logging: Use the
Loggerutility for all logging purposes. Don't use console.log or similar methods directly. - Test Running: Use tools over tasks over scripts to run tests.
- Commands: When adding a new command, consider whether it should be available in the command palette, context menus, or both. Add the appropriate menu entries in
package.jsonto ensure the command is properly included, or excluded (command palette), from menus.
- Never touch the yarn.lock file.
- Run
yarn run lintand alsonpm run hygieneand fix any errors or warnings before committing.
- Use
describeanditblocks from Mocha for structuring tests. - Tests MUST run product code.
- Tests should be placed near the code they are testing, in a
testfolder. Name test fies with a.test.tssuffix.
Last updated: 2025-06-20