Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions .github/instructions/disposable.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 4 additions & 8 deletions .github/instructions/observables.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 2 additions & 0 deletions .github/instructions/telemetry.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,5 @@ this.telemetryService.publicLogError2<ErrorEvent, ErrorClassification>('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
2 changes: 2 additions & 0 deletions .github/instructions/tree-widgets.instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,6 @@ const options = {
- Consider **virtualization settings** for large datasets
- Use **identity providers** for efficient updates and state preservation

## Learnings

---