From 676df97c980f7fed57114cea72e49e168edc50e6 Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Fri, 18 Jun 2021 20:42:39 -0700 Subject: [PATCH] Attempt to fix the metadata test. --- src/features/sourceGeneratedDocumentProvider.ts | 2 +- test/integrationTests/definitionProvider.test.ts | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/features/sourceGeneratedDocumentProvider.ts b/src/features/sourceGeneratedDocumentProvider.ts index 721e6dcc0..13a9e3db6 100644 --- a/src/features/sourceGeneratedDocumentProvider.ts +++ b/src/features/sourceGeneratedDocumentProvider.ts @@ -101,7 +101,7 @@ export default class SourceGeneratedDocumentProvider implements TextDocumentCont let triggerUpdate = false; if (this._uriToDocumentInfo.has(uriString)) { - // Old version of the file in the cache. Remove it, and after it's replace trigger vscode to update the file. + // Old version of the file in the cache. Remove it, and after it's replaced trigger vscode to update the file. this._documents.delete(fileInfo); this._uriToDocumentInfo.delete(uriString); triggerUpdate = true; diff --git a/test/integrationTests/definitionProvider.test.ts b/test/integrationTests/definitionProvider.test.ts index 1becac39d..3a0ba53d5 100644 --- a/test/integrationTests/definitionProvider.test.ts +++ b/test/integrationTests/definitionProvider.test.ts @@ -20,8 +20,8 @@ suite(`${CSharpDefinitionProvider.name}: ${testAssetWorkspace.description}`, () this.skip(); } - await activateCSharpExtension(); - await testAssetWorkspace.restore(); + const activation = await activateCSharpExtension(); + await testAssetWorkspace.restoreAndWait(activation); const fileName = 'definition.cs'; const projectDirectory = testAssetWorkspace.projects[0].projectDirectoryPath; @@ -41,6 +41,9 @@ suite(`${CSharpDefinitionProvider.name}: ${testAssetWorkspace.description}`, () }); test("Returns the definition from Metadata", async () => { + const omnisharpConfig = vscode.workspace.getConfiguration('omnisharp'); + await omnisharpConfig.update('enableDecompilationSupport', false, vscode.ConfigurationTarget.Global); + const definitionList = (await vscode.commands.executeCommand("vscode.executeDefinitionProvider", fileUri, new vscode.Position(10, 25))); expect(definitionList.length).to.be.equal(1); expect(definitionList[0]).to.exist;