Merge pull request #158782 from Semesse/exthost-lf-test

Fix exthost language features test
This commit is contained in:
Johannes Rieken 2022-08-23 14:09:13 +02:00 committed by GitHub
commit d5a59298e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -411,11 +411,10 @@ suite('ExtHostLanguageFeatures', function () {
}));
await rpcProtocol.sync();
getHoverPromise(languageFeaturesService.hoverProvider, model, new EditorPosition(1, 1), CancellationToken.None).then(value => {
assert.strictEqual(value.length, 1);
const [entry] = value;
assert.deepStrictEqual(entry.range, { startLineNumber: 1, startColumn: 1, endLineNumber: 1, endColumn: 5 });
});
const hovers = await getHoverPromise(languageFeaturesService.hoverProvider, model, new EditorPosition(1, 1), CancellationToken.None);
assert.strictEqual(hovers.length, 1);
const [entry] = hovers;
assert.deepStrictEqual(entry.range, { startLineNumber: 1, startColumn: 1, endLineNumber: 1, endColumn: 5 });
});
@ -428,11 +427,10 @@ suite('ExtHostLanguageFeatures', function () {
}));
await rpcProtocol.sync();
getHoverPromise(languageFeaturesService.hoverProvider, model, new EditorPosition(1, 1), CancellationToken.None).then(value => {
assert.strictEqual(value.length, 1);
const [entry] = value;
assert.deepStrictEqual(entry.range, { startLineNumber: 4, startColumn: 1, endLineNumber: 9, endColumn: 8 });
});
const hovers = await getHoverPromise(languageFeaturesService.hoverProvider, model, new EditorPosition(1, 1), CancellationToken.None);
assert.strictEqual(hovers.length, 1);
const [entry] = hovers;
assert.deepStrictEqual(entry.range, { startLineNumber: 4, startColumn: 1, endLineNumber: 9, endColumn: 8 });
});
@ -473,9 +471,8 @@ suite('ExtHostLanguageFeatures', function () {
}));
await rpcProtocol.sync();
getHoverPromise(languageFeaturesService.hoverProvider, model, new EditorPosition(1, 1), CancellationToken.None).then(value => {
assert.strictEqual(value.length, 1);
});
const hovers = await getHoverPromise(languageFeaturesService.hoverProvider, model, new EditorPosition(1, 1), CancellationToken.None);
assert.strictEqual(hovers.length, 1);
});
// --- occurrences