From a27d8ada2f0909fa85c009f672a4ac86ab2b54b4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 31 Oct 2025 01:38:16 +0000 Subject: [PATCH 1/2] Initial plan From 06226357f094abdda0747805b798cfa869882a14 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 31 Oct 2025 01:52:13 +0000 Subject: [PATCH 2/2] Add Learnings sections to all instruction files Co-authored-by: kieferrm <4674940+kieferrm@users.noreply.github.com> --- .github/copilot-instructions.md | 2 ++ .github/instructions/disposable.instructions.md | 2 ++ .github/instructions/observables.instructions.md | 12 ++++-------- .github/instructions/telemetry.instructions.md | 2 ++ .github/instructions/tree-widgets.instructions.md | 2 ++ 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index d3e08231baf84..651dcae73f44a 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -133,3 +133,5 @@ function f(x: number, y: string): void { } - 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 - 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. - Never duplicate imports. Always reuse existing imports if they are present. + +## Learnings diff --git a/.github/instructions/disposable.instructions.md b/.github/instructions/disposable.instructions.md index 06e1b62f7e38b..b533f2675c3e7 100644 --- a/.github/instructions/disposable.instructions.md +++ b/.github/instructions/disposable.instructions.md @@ -18,3 +18,5 @@ Core symbols: * `value: IDisposable | undefined` * `clear()` * 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). + +## Learnings diff --git a/.github/instructions/observables.instructions.md b/.github/instructions/observables.instructions.md index 2aedc290be167..5ea98893c757c 100644 --- a/.github/instructions/observables.instructions.md +++ b/.github/instructions/observables.instructions.md @@ -61,12 +61,8 @@ Most important symbols: * Check src\vs\base\common\observableInternal\index.ts for a list of all observable utitilies +## Learnings -* Important learnings: - * [1] Avoid glitches - * [2] **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) - * [3] **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) +* Avoid glitches (1) +* 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) +* 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) diff --git a/.github/instructions/telemetry.instructions.md b/.github/instructions/telemetry.instructions.md index 1455a219f681e..c69c5ff0f9d69 100644 --- a/.github/instructions/telemetry.instructions.md +++ b/.github/instructions/telemetry.instructions.md @@ -111,3 +111,5 @@ this.telemetryService.publicLogError2('myFeatur - Minimize data collection to essential insights only - Use hashes/categories instead of raw values when possible - Document clear purpose for each data point + +## Learnings diff --git a/.github/instructions/tree-widgets.instructions.md b/.github/instructions/tree-widgets.instructions.md index b5df37f75e69b..b2b8dab995618 100644 --- a/.github/instructions/tree-widgets.instructions.md +++ b/.github/instructions/tree-widgets.instructions.md @@ -154,4 +154,6 @@ const options = { - Consider **virtualization settings** for large datasets - Use **identity providers** for efficient updates and state preservation +## Learnings + ---