Skip to content

Commit

Permalink
Attempt to fix the metadata test.
Browse files Browse the repository at this point in the history
  • Loading branch information
333fred committed Jun 19, 2021
1 parent 627ff24 commit 676df97
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/features/sourceGeneratedDocumentProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 5 additions & 2 deletions test/integrationTests/definitionProvider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 = <vscode.Location[]>(await vscode.commands.executeCommand("vscode.executeDefinitionProvider", fileUri, new vscode.Position(10, 25)));
expect(definitionList.length).to.be.equal(1);
expect(definitionList[0]).to.exist;
Expand Down

0 comments on commit 676df97

Please sign in to comment.