Skip to content

Commit 0622635

Browse files
Copilotkieferrm
andcommitted
Add Learnings sections to all instruction files
Co-authored-by: kieferrm <[email protected]>
1 parent a27d8ad commit 0622635

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

.github/copilot-instructions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,5 @@ function f(x: number, y: string): void { }
133133
- If you create any temporary new files, scripts, or helper files for iteration, clean up these files by removing them at the end of the task
134134
- Do not use `any` or `unknown` as the type for variables, parameters, or return values unless absolutely necessary. If they need type annotations, they should have proper types or interfaces defined.
135135
- Never duplicate imports. Always reuse existing imports if they are present.
136+
137+
## Learnings

.github/instructions/disposable.instructions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ Core symbols:
1818
* `value: IDisposable | undefined`
1919
* `clear()`
2020
* A value that enters a mutable disposable (at least once) will be disposed the latest when the mutable disposable is disposed (or when the value is replaced or cleared).
21+
22+
## Learnings

.github/instructions/observables.instructions.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,8 @@ Most important symbols:
6161

6262
* Check src\vs\base\common\observableInternal\index.ts for a list of all observable utitilies
6363

64+
## Learnings
6465

65-
* Important learnings:
66-
* [1] Avoid glitches
67-
* [2] **Choose the right observable value type:**
68-
* Use `observableValue(owner, initialValue)` for regular values
69-
* Use `disposableObservableValue(owner, initialValue)` when storing disposable values - it automatically disposes the previous value when a new one is set, and disposes the current value when the observable itself is disposed (similar to `MutableDisposable` behavior)
70-
* [3] **Choose the right event observable pattern:**
71-
* Use `observableFromEvent(owner, event, valueComputer)` when you need to track a computed value that changes with the event, and you want updates only when the computed value actually changes
72-
* Use `observableSignalFromEvent(owner, event)` when you need to force re-computation every time the event fires, regardless of value stability. This is important when the computed value might not change but dependent computations need fresh context (e.g., workspace folder changes where the folder array reference might be the same but file path calculations need to be refreshed)
66+
* Avoid glitches (1)
67+
* Choose the right observable value type: Use `observableValue(owner, initialValue)` for regular values. Use `disposableObservableValue(owner, initialValue)` when storing disposable values - it automatically disposes the previous value when a new one is set, and disposes the current value when the observable itself is disposed (similar to `MutableDisposable` behavior) (1)
68+
* Choose the right event observable pattern: Use `observableFromEvent(owner, event, valueComputer)` when you need to track a computed value that changes with the event, and you want updates only when the computed value actually changes. Use `observableSignalFromEvent(owner, event)` when you need to force re-computation every time the event fires, regardless of value stability. This is important when the computed value might not change but dependent computations need fresh context (e.g., workspace folder changes where the folder array reference might be the same but file path calculations need to be refreshed) (1)

.github/instructions/telemetry.instructions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,5 @@ this.telemetryService.publicLogError2<ErrorEvent, ErrorClassification>('myFeatur
111111
- Minimize data collection to essential insights only
112112
- Use hashes/categories instead of raw values when possible
113113
- Document clear purpose for each data point
114+
115+
## Learnings

.github/instructions/tree-widgets.instructions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,4 +154,6 @@ const options = {
154154
- Consider **virtualization settings** for large datasets
155155
- Use **identity providers** for efficient updates and state preservation
156156

157+
## Learnings
158+
157159
---

0 commit comments

Comments
 (0)