diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index af0becdc630..a100345f459 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -137,3 +137,6 @@ function f(x: number, y: string): void { } - When adding file watching, prefer correlated file watchers (via fileService.createWatcher) to shared ones. - When adding tooltips to UI elements, prefer the use of IHoverService service. - Do not duplicate code. Always look for existing utility functions, helpers, or patterns in the codebase before implementing new functionality. Reuse and extend existing code whenever possible. + +## Learnings +- Minimize the amount of assertions in tests. Prefer one snapshot-style `assert.deepStrictEqual` over multiple precise assertions, as they are much more difficult to understand and to update. diff --git a/.github/instructions/learnings.instructions.md b/.github/instructions/learnings.instructions.md index 78a9f52a06e..9358a943e3d 100644 --- a/.github/instructions/learnings.instructions.md +++ b/.github/instructions/learnings.instructions.md @@ -8,14 +8,13 @@ It is a meta-instruction file. Structure of learnings: * Each instruction file has a "Learnings" section. -* Each learning has a counter that indicates how often that learning was useful (initially 1). * Each learning has a 1-4 sentences description of the learning. Example: ```markdown ## Learnings -* Prefer `const` over `let` whenever possible (1) -* Avoid `any` type (3) +* Prefer `const` over `let` whenever possible +* Avoid `any` type ``` When the user tells you "learn!", you should: @@ -23,10 +22,7 @@ When the user tells you "learn!", you should: * identify the problem that you created * identify why it was a problem * identify how you were told to fix it/how the user fixed it + * reflect over it, maybe it can be generalized? Avoid too specific learnings. * create a learning (1-4 sentences) from that * Write this out to the user and reflect over these sentences * then, add the reflected learning to the "Learnings" section of the most appropriate instruction file - - - Important: Whenever a learning was really useful, increase the counter!! - When a learning was not useful and just caused more problems, decrease the counter.