testing: improve decoration syncing (#159705)

So, two problems. One, we didn't actually fully re-sync testing
decorations when explicitly updated by the extension, since we attempted
to get the test URI from the _diff_ which would never actually be
present on single updates (since the test item URI cannot be changed).
I think this was the main problem people saw.

So, this fixes that. It also applies a change so that we only sync the
ranges to what the extension gives us if the document version is up to
date with what was in the extension host. This should avoid syncing
decorations to the wrong place--instead just use VS Code's own decoration
location tracking until we get a newer update from the extension.

Fixes #158475
Fixes #153304
This commit is contained in:
Connor Peet
2022-08-31 12:57:49 -07:00
committed by GitHub
parent aaa72d5b67
commit c11dabf9ce
8 changed files with 51 additions and 26 deletions

View File

@@ -183,7 +183,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
const extHostWebviewPanels = rpcProtocol.set(ExtHostContext.ExtHostWebviewPanels, new ExtHostWebviewPanels(rpcProtocol, extHostWebviews, extHostWorkspace));
const extHostCustomEditors = rpcProtocol.set(ExtHostContext.ExtHostCustomEditors, new ExtHostCustomEditors(rpcProtocol, extHostDocuments, extensionStoragePaths, extHostWebviews, extHostWebviewPanels));
const extHostWebviewViews = rpcProtocol.set(ExtHostContext.ExtHostWebviewViews, new ExtHostWebviewViews(rpcProtocol, extHostWebviews));
const extHostTesting = rpcProtocol.set(ExtHostContext.ExtHostTesting, new ExtHostTesting(rpcProtocol, extHostCommands));
const extHostTesting = rpcProtocol.set(ExtHostContext.ExtHostTesting, new ExtHostTesting(rpcProtocol, extHostCommands, extHostDocumentsAndEditors));
const extHostUriOpeners = rpcProtocol.set(ExtHostContext.ExtHostUriOpeners, new ExtHostUriOpeners(rpcProtocol));
rpcProtocol.set(ExtHostContext.ExtHostInteractive, new ExtHostInteractive(rpcProtocol, extHostNotebook, extHostDocumentsAndEditors, extHostCommands, extHostLogService));