Skip to content

diffr web: create file models without a language selection - #1096

Open
milanb17 wants to merge 1 commit into
claude/project-thread-hwb7l0from
claude/diffr-web-release-models
Open

milanb17 wants to merge 1 commit into
claude/project-thread-hwb7l0from
claude/diffr-web-release-models

Conversation

@milanb17

Copy link
Copy Markdown
Contributor

Summary

Create diffr web's file models as plain text with no language selection, so they stop tripping the language service's leak check. Stacks on #1022; merge #1022 first. Independent of #1093–#1095.

  • Each file's two models were made with languageService.createById(PLAINTEXT_LANGUAGE_ID). A language selection subscribes its model to LanguageService.onDidChange, so a large comparison (vite v5.3.0...v5.4.0, 217 files, ~430 models) crossed the emitter's leak threshold and raised Uncaught Error: potential listener LEAK detected at 200, 300 and 400 listeners.
  • createModel(text, null, uri) gives plain text without the subscription. These models never change language: diffr's decorations colour the code.

Evidence

  • Desktop Chrome, vite v5.3.0...v5.4.0 with every file diffed: before, three leak warnings and three uncaught errors; after, no console warnings or errors. JS heap 116 MB after, 122–132 MB before.
  • Syntax colours, folds and unchanged-line bands render as before.
  • Browser typecheck, lint and format pass. No tests cover this file.

Merge Danger

Door: two-way; revert the commit.

Blast Radius: diffr web's desktop (Monaco) view. A model that relied on its language selection would lose language-based behaviour; these are plain text throughout.

Each model was created with a plain-text language selection, which
subscribes it to the language service. A large comparison's ~430 models
tripped the emitter's leak check, raised as uncaught errors at 200, 300
and 400 listeners. The models never change language, since diffr's
decorations colour the code, so they now take plain text directly.

Agent-Session: 429958d8-68f3-4f68-bd3b-a8371e7feb8e
Agent-Session: 5eb4067a-b2f6-4508-a6dd-0471ff2c14d1

This branch has not been deployed

No deployments
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.

1 participant