mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-21 09:08:53 +01:00
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:
@@ -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,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user