Skip to content

chat: simplify symbol reference cache to an array#300489

Merged
connor4312 merged 3 commits intomainfrom
connor4312/symbol-cache-array
Mar 10, 2026
Merged

chat: simplify symbol reference cache to an array#300489
connor4312 merged 3 commits intomainfrom
connor4312/symbol-cache-array

Conversation

@connor4312
Copy link
Copy Markdown
Member

Replaces the Map-based symbol reference cache with a simple array that
keeps only the last 3 copied symbols. This removes the 15-second TTL
expiration logic and relies on insertion order instead.

  • Changed symbolReferenceCache from Map to array
  • Removed symbolCacheTtlMs constant and pruning logic
  • Added symbolCacheMaxSize constant for max entries
  • Simplified cache lookups with array.find()
  • Automatically evicts oldest entry when exceeding capacity

(Commit message generated by Copilot)

Replaces the Map-based symbol reference cache with a simple array that
keeps only the last 3 copied symbols. This removes the 15-second TTL
expiration logic and relies on insertion order instead.

- Changed symbolReferenceCache from Map to array
- Removed symbolCacheTtlMs constant and pruning logic
- Added symbolCacheMaxSize constant for max entries
- Simplified cache lookups with array.find()
- Automatically evicts oldest entry when exceeding capacity

(Commit message generated by Copilot)
Copilot AI review requested due to automatic review settings March 10, 2026 17:10
@connor4312 connor4312 enabled auto-merge (squash) March 10, 2026 17:10
@vs-code-engineering vs-code-engineering bot added this to the 1.112.0 milestone Mar 10, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR simplifies the chat “paste symbol reference” caching logic by replacing the previous Map + TTL-based cache with a small fixed-size array that retains only the most recently cached entries.

Changes:

  • Replaced symbolReferenceCache from Map to an array with a max size of 3 entries.
  • Removed the TTL constant and cache pruning logic.
  • Simplified cache lookup to an array search and eviction by removing the oldest entry.

You can also share your feedback on Copilot code review. Take the survey.

@connor4312 connor4312 merged commit ea9e938 into main Mar 10, 2026
19 checks passed
@connor4312 connor4312 deleted the connor4312/symbol-cache-array branch March 10, 2026 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants