Skip to content

Only update text model when blob loads

Warren Gifford requested to merge extension-doc-sync into main

Created by: tjkandala

Fix #14965 (closed).

Before (starts on windows.ts)
After (starts on windows.ts)

Tested with a mock extension that decorates lines with absolute import paths. Note that it used to decorate lines with relative import paths on which the previous file had absolute import paths.

Fix: Only emit modelChanges when blobOrError has updated. Previously, since blobOrError is only updated after file info, some emitted models had the AbsoluteRepoFile data of the currently viewed file but the text content of the previously viewed file.

What happened when blobOrError loaded? The model service already had an entry for the inaccurate model, so extensions never saw the real text content.

We can't compare blobOrError.content since some files may actually have the same text content, in which case modelChanges wouldn't emit.

Merge request reports

Loading