mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-22 12:50:29 -04:00
Merge from vscode 3c6f6af7347d38e87bc6406024e8dcf9e9bce229 (#8962)
* Merge from vscode 3c6f6af7347d38e87bc6406024e8dcf9e9bce229 * skip failing tests * update mac build image
This commit is contained in:
committed by
Karl Burtram
parent
0eaee18dc4
commit
fefe1454de
@@ -220,6 +220,43 @@ suite('CodeAction', () => {
|
||||
}
|
||||
});
|
||||
|
||||
test('getCodeActions no invoke a provider that has been excluded #84602', async function () {
|
||||
const baseType = CodeActionKind.Refactor;
|
||||
const subType = CodeActionKind.Refactor.append('sub');
|
||||
|
||||
disposables.add(modes.CodeActionProviderRegistry.register('fooLang', staticCodeActionProvider(
|
||||
{ title: 'a', kind: baseType.value }
|
||||
)));
|
||||
|
||||
let didInvoke = false;
|
||||
disposables.add(modes.CodeActionProviderRegistry.register('fooLang', new class implements modes.CodeActionProvider {
|
||||
|
||||
providedCodeActionKinds = [subType.value];
|
||||
|
||||
provideCodeActions(): modes.ProviderResult<modes.CodeActionList> {
|
||||
didInvoke = true;
|
||||
return {
|
||||
actions: [
|
||||
{ title: 'x', kind: subType.value }
|
||||
],
|
||||
dispose: () => { }
|
||||
};
|
||||
}
|
||||
}));
|
||||
|
||||
{
|
||||
const { validActions: actions } = await getCodeActions(model, new Range(1, 1, 2, 1), {
|
||||
type: modes.CodeActionTriggerType.Auto, filter: {
|
||||
include: baseType,
|
||||
excludes: [subType],
|
||||
}
|
||||
}, CancellationToken.None);
|
||||
assert.strictEqual(didInvoke, false);
|
||||
assert.equal(actions.length, 1);
|
||||
assert.strictEqual(actions[0].title, 'a');
|
||||
}
|
||||
});
|
||||
|
||||
test('getCodeActions should not invoke code action providers filtered out by providedCodeActionKinds', async function () {
|
||||
let wasInvoked = false;
|
||||
const provider = new class implements modes.CodeActionProvider {
|
||||
|
||||
Reference in New Issue
Block a user