fix two issues with notebookType and document selectors, (1) make sure that notebookType: * matches only when a notebook is around, (2) include notebookType-property when converting from extHost type to renderer type, fyi @dbaeumer

This commit is contained in:
Johannes
2022-04-20 09:47:06 +02:00
parent 89d1004371
commit 5931aa8ed6
4 changed files with 35 additions and 3 deletions

View File

@@ -6,7 +6,7 @@
import * as assert from 'assert';
import * as extHostTypes from 'vs/workbench/api/common/extHostTypes';
import { MarkdownString, NotebookCellOutputItem, NotebookData } from 'vs/workbench/api/common/extHostTypeConverters';
import { MarkdownString, NotebookCellOutputItem, NotebookData, LanguageSelector } from 'vs/workbench/api/common/extHostTypeConverters';
import { isEmptyObject } from 'vs/base/common/types';
import { forEach } from 'vs/base/common/collections';
import { LogLevel as _MainLogLevel } from 'vs/platform/log/common/log';
@@ -111,4 +111,16 @@ suite('ExtHostTypeConverter', function () {
assert.strictEqual(item2.mime, item.mime);
assert.deepStrictEqual(Array.from(item2.data), Array.from(item.data));
});
test('LanguageSelector', function () {
const out = LanguageSelector.from({ language: 'bat', notebookType: 'xxx' });
assert.ok(typeof out === 'object');
assert.deepStrictEqual(out, {
language: 'bat',
notebookType: 'xxx',
scheme: undefined,
pattern: undefined,
exclusive: undefined,
});
});
});