@@ -8,18 +8,18 @@ This file provides instructions for AI coding assistants (GitHub Copilot, Claude
88src/
99├── commands/ # Add new commands here (one file per feature group)
1010├── services/ # Business logic, API clients
11- ├── constants/ # All IDs, keys, URLs (commands.ts)
1211├── data/ # Plugin metadata (plugins.json) - edit JSON, not code
13- ├── utils/ # Pure helper functions
12+ ├── utils/ # Pure helper functions + getDiagnosticCode, getSchemaUrl
1413├── test/ # Tests split by domain (*.test.ts)
14+ ├── constants.ts # All IDs, keys, URLs
1515└── *.ts # Core extension modules
1616```
1717
1818## Common Tasks
1919
2020### Adding a New Command
2121
22- 1 . ** Register the command ID** in ` src/constants/commands .ts ` :
22+ 1 . ** Register the command ID** in ` src/constants.ts ` :
2323 ``` typescript
2424 export const Commands = {
2525 // ... existing
3838
39393 . ** Create/update command file** in ` src/commands/ ` :
4040 ``` typescript
41+ import { Commands } from ' ../constants' ;
42+
4143 export function registerMyCommands(context : vscode .ExtensionContext ) {
4244 context .subscriptions .push (
4345 vscode .commands .registerCommand (Commands .MY_NEW_COMMAND , async () => {
7274
7375### Adding a Diagnostic
7476
75- 1 . Add diagnostic code to ` DiagnosticCodes ` in ` src/constants/commands .ts `
77+ 1 . Add diagnostic code to ` DiagnosticCodes ` in ` src/constants.ts `
76782 . Add diagnostic creation in ` src/diagnostics.ts `
77793 . Add code action (quick fix) in ` src/code-actions.ts `
78804 . Add test in ` src/test/schema.test.ts ` or ` src/test/plugins.test.ts `
8688### Imports
8789- Use barrel exports from ` index.ts ` files:
8890 ``` typescript
89- import { Commands , DiagnosticCodes } from ' ./constants' ;
90- import { DevProxyApiClient } from ' ./services ' ;
91+ import { Commands , DiagnosticCodes } from ' .. /constants' ;
92+ import { getDiagnosticCode , getSchemaUrl } from ' ../utils ' ;
9193 ```
9294
9395### Testing
115117| File | Purpose |
116118| ------| ---------|
117119| ` src/extension.ts ` | Entry point, activation |
118- | ` src/constants/commands .ts ` | All command IDs, context keys, URLs |
120+ | ` src/constants.ts ` | All command IDs, context keys, URLs |
119121| ` src/data/plugins.json ` | Plugin metadata (editable without code) |
120122| ` src/services/api-client.ts ` | All Dev Proxy HTTP API calls |
121123| ` src/test/helpers.ts ` | Test utilities, mock factories |
0 commit comments