mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-07 15:26:49 +01:00
Merge branch 'master' into joh/bulkEditPreview
This commit is contained in:
+1
-1
@@ -43,7 +43,7 @@
|
||||
"minimist": "^1.2.0",
|
||||
"request": "^2.85.0",
|
||||
"terser": "4.3.8",
|
||||
"typescript": "3.7.3",
|
||||
"typescript": "^3.8.0-dev.20200104",
|
||||
"vsce": "1.48.0",
|
||||
"vscode-telemetry-extractor": "^1.5.4",
|
||||
"xml2js": "^0.4.17"
|
||||
|
||||
+5
-5
@@ -2453,16 +2453,16 @@ typed-rest-client@^0.9.0:
|
||||
tunnel "0.0.4"
|
||||
underscore "1.8.3"
|
||||
|
||||
typescript@3.7.3:
|
||||
version "3.7.3"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.3.tgz#b36840668a16458a7025b9eabfad11b66ab85c69"
|
||||
integrity sha512-Mcr/Qk7hXqFBXMN7p7Lusj1ktCBydylfQM/FZCk5glCNQJrCUKPkMHdo9R0MTFWsC/4kPFvDS0fDPvukfCkFsw==
|
||||
|
||||
typescript@^3.0.1:
|
||||
version "3.5.3"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.5.3.tgz#c830f657f93f1ea846819e929092f5fe5983e977"
|
||||
integrity sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g==
|
||||
|
||||
typescript@^3.8.0-dev.20200104:
|
||||
version "3.8.0-dev.20200104"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.0-dev.20200104.tgz#521b2f0b5a288b6e3f8a095525f64712330cc649"
|
||||
integrity sha512-Zdb8X1uzvUPrRvRBqega83NxqCuN/kyxuXG1u8BV10mGOqfwQb0SreSDoDDM1zUgrqFZ93neVh3DVyWTvx6XlA==
|
||||
|
||||
typical@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/typical/-/typical-4.0.0.tgz#cbeaff3b9d7ae1e2bbfaf5a4e6f11eccfde94fc4"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
|
||||
"Once accepted there, we are happy to receive an update request."
|
||||
],
|
||||
"version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/c9c955af17ed0c86ebce32e0f26c72f0a2925937",
|
||||
"version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/b7ef0941e38d56292d19ee7706a558dbff6c3a35",
|
||||
"name": "JavaScript (with React support)",
|
||||
"scopeName": "source.js",
|
||||
"patterns": [
|
||||
@@ -1825,7 +1825,7 @@
|
||||
},
|
||||
"access-modifier": {
|
||||
"name": "storage.modifier.js",
|
||||
"match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(abstract|public|protected|private|readonly|static)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))"
|
||||
"match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(abstract|public|protected|private|readonly|static|declare)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))"
|
||||
},
|
||||
"property-accessor": {
|
||||
"name": "storage.type.property.js",
|
||||
@@ -2755,6 +2755,39 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(?<=:)\\s*(async)?\\s*(?=\\<\\s*$)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "storage.modifier.async.js"
|
||||
}
|
||||
},
|
||||
"end": "(?<=\\>)",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#type-parameters"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(?<=\\>)\\s*(\\()(?=\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "meta.brace.round.js"
|
||||
}
|
||||
},
|
||||
"end": "\\)",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "meta.brace.round.js"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#expression-inside-possibly-arrow-parens"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"include": "#possibly-arrow-return-type"
|
||||
},
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
|
||||
"Once accepted there, we are happy to receive an update request."
|
||||
],
|
||||
"version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/c9c955af17ed0c86ebce32e0f26c72f0a2925937",
|
||||
"version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/b7ef0941e38d56292d19ee7706a558dbff6c3a35",
|
||||
"name": "JavaScript (with React support)",
|
||||
"scopeName": "source.js.jsx",
|
||||
"patterns": [
|
||||
@@ -1825,7 +1825,7 @@
|
||||
},
|
||||
"access-modifier": {
|
||||
"name": "storage.modifier.js.jsx",
|
||||
"match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(abstract|public|protected|private|readonly|static)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))"
|
||||
"match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(abstract|public|protected|private|readonly|static|declare)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))"
|
||||
},
|
||||
"property-accessor": {
|
||||
"name": "storage.type.property.js.jsx",
|
||||
@@ -2755,6 +2755,39 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(?<=:)\\s*(async)?\\s*(?=\\<\\s*$)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "storage.modifier.async.js.jsx"
|
||||
}
|
||||
},
|
||||
"end": "(?<=\\>)",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#type-parameters"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(?<=\\>)\\s*(\\()(?=\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "meta.brace.round.js.jsx"
|
||||
}
|
||||
},
|
||||
"end": "\\)",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "meta.brace.round.js.jsx"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#expression-inside-possibly-arrow-parens"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"include": "#possibly-arrow-return-type"
|
||||
},
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"git": {
|
||||
"name": "TypeScript-TmLanguage",
|
||||
"repositoryUrl": "https://github.com/Microsoft/TypeScript-TmLanguage",
|
||||
"commitHash": "c9c955af17ed0c86ebce32e0f26c72f0a2925937"
|
||||
"commitHash": "b7ef0941e38d56292d19ee7706a558dbff6c3a35"
|
||||
}
|
||||
},
|
||||
"license": "MIT",
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
|
||||
"Once accepted there, we are happy to receive an update request."
|
||||
],
|
||||
"version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/c9c955af17ed0c86ebce32e0f26c72f0a2925937",
|
||||
"version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/b7ef0941e38d56292d19ee7706a558dbff6c3a35",
|
||||
"name": "TypeScript",
|
||||
"scopeName": "source.ts",
|
||||
"patterns": [
|
||||
@@ -1822,7 +1822,7 @@
|
||||
},
|
||||
"access-modifier": {
|
||||
"name": "storage.modifier.ts",
|
||||
"match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(abstract|public|protected|private|readonly|static)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))"
|
||||
"match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(abstract|public|protected|private|readonly|static|declare)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))"
|
||||
},
|
||||
"property-accessor": {
|
||||
"name": "storage.type.property.ts",
|
||||
@@ -2752,6 +2752,39 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(?<=:)\\s*(async)?\\s*(?=\\<\\s*$)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "storage.modifier.async.ts"
|
||||
}
|
||||
},
|
||||
"end": "(?<=\\>)",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#type-parameters"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(?<=\\>)\\s*(\\()(?=\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "meta.brace.round.ts"
|
||||
}
|
||||
},
|
||||
"end": "\\)",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "meta.brace.round.ts"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#expression-inside-possibly-arrow-parens"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"include": "#possibly-arrow-return-type"
|
||||
},
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
|
||||
"Once accepted there, we are happy to receive an update request."
|
||||
],
|
||||
"version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/c9c955af17ed0c86ebce32e0f26c72f0a2925937",
|
||||
"version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/b7ef0941e38d56292d19ee7706a558dbff6c3a35",
|
||||
"name": "TypeScriptReact",
|
||||
"scopeName": "source.tsx",
|
||||
"patterns": [
|
||||
@@ -1825,7 +1825,7 @@
|
||||
},
|
||||
"access-modifier": {
|
||||
"name": "storage.modifier.tsx",
|
||||
"match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(abstract|public|protected|private|readonly|static)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))"
|
||||
"match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(abstract|public|protected|private|readonly|static|declare)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))"
|
||||
},
|
||||
"property-accessor": {
|
||||
"name": "storage.type.property.tsx",
|
||||
@@ -2755,6 +2755,39 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(?<=:)\\s*(async)?\\s*(?=\\<\\s*$)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "storage.modifier.async.tsx"
|
||||
}
|
||||
},
|
||||
"end": "(?<=\\>)",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#type-parameters"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(?<=\\>)\\s*(\\()(?=\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{[^\\{\\}]*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[[^\\[\\]]*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<[^<>]+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "meta.brace.round.tsx"
|
||||
}
|
||||
},
|
||||
"end": "\\)",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "meta.brace.round.tsx"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#expression-inside-possibly-arrow-parens"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"include": "#possibly-arrow-return-type"
|
||||
},
|
||||
|
||||
@@ -24,7 +24,7 @@ import { TypeScriptPluginPathsProvider } from './utils/pluginPathsProvider';
|
||||
import { PluginManager } from './utils/plugins';
|
||||
import TelemetryReporter, { VSCodeTelemetryReporter } from './utils/telemetry';
|
||||
import Tracer from './utils/tracer';
|
||||
import { inferredProjectConfig } from './utils/tsconfig';
|
||||
import { inferredProjectCompilerOptions } from './utils/tsconfig';
|
||||
import { TypeScriptVersionPicker } from './utils/versionPicker';
|
||||
import { TypeScriptVersion, TypeScriptVersionProvider } from './utils/versionProvider';
|
||||
|
||||
@@ -498,7 +498,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType
|
||||
|
||||
private getCompilerOptionsForInferredProjects(configuration: TypeScriptServiceConfiguration): Proto.ExternalProjectCompilerOptions {
|
||||
return {
|
||||
...inferredProjectConfig(configuration),
|
||||
...inferredProjectCompilerOptions(true, configuration),
|
||||
allowJs: true,
|
||||
allowSyntheticDefaultImports: true,
|
||||
allowNonTsExtensions: true,
|
||||
|
||||
@@ -28,7 +28,15 @@ function getTagBodyText(tag: Proto.JSDocTagInfo): string | undefined {
|
||||
} else {
|
||||
return makeCodeblock(tag.text);
|
||||
}
|
||||
case 'author':
|
||||
// fix obsucated email address, #80898
|
||||
const emailMatch = tag.text.match(/(.+)\s<([-.\w]+@[-.\w]+)>/);
|
||||
|
||||
if (emailMatch === null) {
|
||||
return tag.text;
|
||||
} else {
|
||||
return `${emailMatch[1]} ${emailMatch[2]}`;
|
||||
}
|
||||
case 'default':
|
||||
return makeCodeblock(tag.text);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,8 @@ export function isImplicitProjectConfigFile(configFileName: string) {
|
||||
return configFileName.startsWith('/dev/null/');
|
||||
}
|
||||
|
||||
export function inferredProjectConfig(
|
||||
export function inferredProjectCompilerOptions(
|
||||
isTypeScriptProject: boolean,
|
||||
serviceConfig: TypeScriptServiceConfiguration,
|
||||
): Proto.ExternalProjectCompilerOptions {
|
||||
const projectConfig: Proto.ExternalProjectCompilerOptions = {
|
||||
@@ -23,19 +24,27 @@ export function inferredProjectConfig(
|
||||
|
||||
if (serviceConfig.checkJs) {
|
||||
projectConfig.checkJs = true;
|
||||
if (isTypeScriptProject) {
|
||||
projectConfig.allowJs = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (serviceConfig.experimentalDecorators) {
|
||||
projectConfig.experimentalDecorators = true;
|
||||
}
|
||||
|
||||
if (isTypeScriptProject) {
|
||||
projectConfig.sourceMap = true;
|
||||
}
|
||||
|
||||
return projectConfig;
|
||||
}
|
||||
|
||||
function inferredProjectConfigSnippet(
|
||||
isTypeScriptProject: boolean,
|
||||
config: TypeScriptServiceConfiguration
|
||||
) {
|
||||
const baseConfig = inferredProjectConfig(config);
|
||||
const baseConfig = inferredProjectCompilerOptions(isTypeScriptProject, config);
|
||||
const compilerOptions = Object.keys(baseConfig).map(key => `"${key}": ${JSON.stringify(baseConfig[key])}`);
|
||||
return new vscode.SnippetString(`{
|
||||
"compilerOptions": {
|
||||
@@ -62,8 +71,8 @@ export async function openOrCreateConfigFile(
|
||||
const doc = await vscode.workspace.openTextDocument(configFile.with({ scheme: 'untitled' }));
|
||||
const editor = await vscode.window.showTextDocument(doc, col);
|
||||
if (editor.document.getText().length === 0) {
|
||||
await editor.insertSnippet(inferredProjectConfigSnippet(config));
|
||||
await editor.insertSnippet(inferredProjectConfigSnippet(isTypeScriptProject, config));
|
||||
}
|
||||
return editor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,7 +69,64 @@ suite('workspace-namespace', () => {
|
||||
},
|
||||
resolveTask(_task: Task): Task | undefined {
|
||||
try {
|
||||
assert.fail('resolveTask should not trigger during the test');
|
||||
assert.fail('resolveTask should not trigger during the test');
|
||||
} catch (e) {
|
||||
done(e);
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
}));
|
||||
commands.executeCommand('workbench.action.tasks.runTask', `${taskType}: ${taskName}`);
|
||||
});
|
||||
|
||||
test('sync CustomExecution task should flush all data on close', (done) => {
|
||||
interface CustomTestingTaskDefinition extends TaskDefinition {
|
||||
/**
|
||||
* One of the task properties. This can be used to customize the task in the tasks.json
|
||||
*/
|
||||
customProp1: string;
|
||||
}
|
||||
const taskType: string = 'customTesting';
|
||||
const taskName = 'First custom task';
|
||||
disposables.push(window.onDidOpenTerminal(term => {
|
||||
disposables.push(window.onDidWriteTerminalData(e => {
|
||||
try {
|
||||
assert.equal(e.data, 'exiting');
|
||||
} catch (e) {
|
||||
done(e);
|
||||
}
|
||||
disposables.push(window.onDidCloseTerminal(() => done()));
|
||||
term.dispose();
|
||||
}));
|
||||
}));
|
||||
disposables.push(tasks.registerTaskProvider(taskType, {
|
||||
provideTasks: () => {
|
||||
const result: Task[] = [];
|
||||
const kind: CustomTestingTaskDefinition = {
|
||||
type: taskType,
|
||||
customProp1: 'testing task one'
|
||||
};
|
||||
const writeEmitter = new EventEmitter<string>();
|
||||
const closeEmitter = new EventEmitter<void>();
|
||||
const execution = new CustomExecution((): Thenable<Pseudoterminal> => {
|
||||
const pty: Pseudoterminal = {
|
||||
onDidWrite: writeEmitter.event,
|
||||
onDidClose: closeEmitter.event,
|
||||
open: () => {
|
||||
writeEmitter.fire('exiting');
|
||||
closeEmitter.fire();
|
||||
},
|
||||
close: () => {}
|
||||
};
|
||||
return Promise.resolve(pty);
|
||||
});
|
||||
const task = new Task2(kind, TaskScope.Workspace, taskName, taskType, execution);
|
||||
result.push(task);
|
||||
return result;
|
||||
},
|
||||
resolveTask(_task: Task): Task | undefined {
|
||||
try {
|
||||
assert.fail('resolveTask should not trigger during the test');
|
||||
} catch (e) {
|
||||
done(e);
|
||||
}
|
||||
|
||||
@@ -43,6 +43,8 @@
|
||||
".publishsettings",
|
||||
".pubxml",
|
||||
".pubxml.user",
|
||||
".rbxlx",
|
||||
".rbxmx",
|
||||
".rdf",
|
||||
".rng",
|
||||
".rss",
|
||||
|
||||
+1
-1
@@ -144,7 +144,7 @@
|
||||
"sinon": "^1.17.2",
|
||||
"source-map": "^0.4.4",
|
||||
"ts-loader": "^4.4.2",
|
||||
"typescript": "3.7.3",
|
||||
"typescript": "^3.8.0-dev.20200104",
|
||||
"typescript-formatter": "7.1.0",
|
||||
"underscore": "^1.8.2",
|
||||
"vinyl": "^2.0.0",
|
||||
|
||||
+1
-5
@@ -24,10 +24,6 @@
|
||||
"./vs"
|
||||
],
|
||||
"exclude": [
|
||||
"./typings/es6-promise.d.ts",
|
||||
"./typings/require-monaco.d.ts",
|
||||
"./typings/xterm.d.ts",
|
||||
"./typings/xterm-addon-search.d.ts",
|
||||
"./typings/xterm-addon-web-links.d.ts"
|
||||
"./typings/es6-promise.d.ts"
|
||||
]
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -12,7 +12,7 @@ interface Map<K, V> {
|
||||
forEach(callbackfn: (value: V, index: K, map: Map<K, V>) => void, thisArg?: any): void;
|
||||
get(key: K): V | undefined;
|
||||
has(key: K): boolean;
|
||||
set(key: K, value?: V): Map<K, V>;
|
||||
set(key: K, value: V): Map<K, V>;
|
||||
readonly size: number;
|
||||
|
||||
// not supported on IE11:
|
||||
|
||||
@@ -129,7 +129,7 @@ export class Button extends Disposable {
|
||||
private applyStyles(): void {
|
||||
if (this._element) {
|
||||
const background = this.buttonBackground ? this.buttonBackground.toString() : '';
|
||||
const foreground = this.buttonForeground ? this.buttonForeground.toString() : null;
|
||||
const foreground = this.buttonForeground ? this.buttonForeground.toString() : '';
|
||||
const border = this.buttonBorder ? this.buttonBorder.toString() : '';
|
||||
|
||||
this._element.style.color = foreground;
|
||||
|
||||
@@ -220,7 +220,7 @@ export class SimpleCheckbox extends Widget {
|
||||
}
|
||||
|
||||
protected applyStyles(): void {
|
||||
this.domNode.style.color = this.styles.checkboxForeground ? this.styles.checkboxForeground.toString() : null;
|
||||
this.domNode.style.color = this.styles.checkboxForeground ? this.styles.checkboxForeground.toString() : '';
|
||||
this.domNode.style.backgroundColor = this.styles.checkboxBackground ? this.styles.checkboxBackground.toString() : '';
|
||||
this.domNode.style.borderColor = this.styles.checkboxBorder ? this.styles.checkboxBorder.toString() : '';
|
||||
}
|
||||
|
||||
@@ -477,7 +477,7 @@ export class InputBox extends Widget {
|
||||
|
||||
const styles = this.stylesForType(this.message.type);
|
||||
spanElement.style.backgroundColor = styles.background ? styles.background.toString() : '';
|
||||
spanElement.style.color = styles.foreground ? styles.foreground.toString() : null;
|
||||
spanElement.style.color = styles.foreground ? styles.foreground.toString() : '';
|
||||
spanElement.style.border = styles.border ? `1px solid ${styles.border}` : '';
|
||||
|
||||
dom.append(div, spanElement);
|
||||
|
||||
@@ -597,12 +597,12 @@ class BaseMenuActionViewItem extends BaseActionViewItem {
|
||||
const border = isSelected && this.menuStyle.selectionBorderColor ? `thin solid ${this.menuStyle.selectionBorderColor}` : '';
|
||||
|
||||
if (this.item) {
|
||||
this.item.style.color = fgColor ? `${fgColor}` : null;
|
||||
this.item.style.backgroundColor = bgColor ? `${bgColor}` : '';
|
||||
this.item.style.color = fgColor ? fgColor.toString() : '';
|
||||
this.item.style.backgroundColor = bgColor ? bgColor.toString() : '';
|
||||
}
|
||||
|
||||
if (this.check) {
|
||||
this.check.style.color = fgColor ? `${fgColor}` : '';
|
||||
this.check.style.color = fgColor ? fgColor.toString() : '';
|
||||
}
|
||||
|
||||
if (this.container) {
|
||||
|
||||
@@ -230,7 +230,7 @@ export abstract class Pane extends Disposable implements IView {
|
||||
toggleClass(this.header, 'expanded', expanded);
|
||||
this.header.setAttribute('aria-expanded', String(expanded));
|
||||
|
||||
this.header.style.color = this.styles.headerForeground ? this.styles.headerForeground.toString() : null;
|
||||
this.header.style.color = this.styles.headerForeground ? this.styles.headerForeground.toString() : '';
|
||||
this.header.style.backgroundColor = this.styles.headerBackground ? this.styles.headerBackground.toString() : '';
|
||||
this.header.style.borderTop = this.styles.headerBorder ? `1px solid ${this.styles.headerBorder}` : '';
|
||||
this._dropBackground = this.styles.dropBackground;
|
||||
|
||||
@@ -668,7 +668,7 @@ export class RunOnceWorker<T> extends RunOnceScheduler {
|
||||
|
||||
export interface IdleDeadline {
|
||||
readonly didTimeout: boolean;
|
||||
timeRemaining(): DOMHighResTimeStamp;
|
||||
timeRemaining(): number;
|
||||
}
|
||||
/**
|
||||
* Execute the callback the next time the browser is idle
|
||||
|
||||
@@ -560,9 +560,9 @@ export function fuzzyScore(pattern: string, patternLow: string, patternStart: nu
|
||||
let wordPos = wordStart;
|
||||
|
||||
// There will be a match, fill in tables
|
||||
for (row = 1, patternPos = patternStart; patternPos < patternLen; row++ , patternPos++) {
|
||||
for (row = 1, patternPos = patternStart; patternPos < patternLen; row++, patternPos++) {
|
||||
|
||||
for (column = 1, wordPos = wordStart; wordPos < wordLen; column++ , wordPos++) {
|
||||
for (column = 1, wordPos = wordStart; wordPos < wordLen; column++, wordPos++) {
|
||||
|
||||
const score = _doScore(pattern, patternLow, patternPos, patternStart, word, wordLow, wordPos);
|
||||
|
||||
|
||||
@@ -406,7 +406,7 @@ export class QuickOpenWidget extends Disposable implements IModelProvider, IThem
|
||||
|
||||
protected applyStyles(): void {
|
||||
if (this.element) {
|
||||
const foreground = this.styles.foreground ? this.styles.foreground.toString() : null;
|
||||
const foreground = this.styles.foreground ? this.styles.foreground.toString() : '';
|
||||
const background = this.styles.background ? this.styles.background.toString() : '';
|
||||
const borderColor = this.styles.borderColor ? this.styles.borderColor.toString() : '';
|
||||
const widgetShadow = this.styles.widgetShadow ? this.styles.widgetShadow.toString() : '';
|
||||
|
||||
@@ -137,14 +137,14 @@ suite('Storage Library', () => {
|
||||
changes.clear();
|
||||
|
||||
// Delete is accepted
|
||||
change.set('foo', undefined);
|
||||
change.set('foo', undefined!);
|
||||
database.fireDidChangeItemsExternal({ items: change });
|
||||
ok(changes.has('foo'));
|
||||
equal(storage.get('foo', null!), null);
|
||||
changes.clear();
|
||||
|
||||
// Nothing happens if changing to same value
|
||||
change.set('foo', undefined);
|
||||
change.set('foo', undefined!);
|
||||
database.fireDidChangeItemsExternal({ items: change });
|
||||
equal(changes.size, 0);
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ export class ShiftCommand implements ICommand {
|
||||
if (this._opts.useTabStops) {
|
||||
// keep track of previous line's "miss-alignment"
|
||||
let previousLineExtraSpaces = 0, extraSpaces = 0;
|
||||
for (let lineNumber = startLine; lineNumber <= endLine; lineNumber++ , previousLineExtraSpaces = extraSpaces) {
|
||||
for (let lineNumber = startLine; lineNumber <= endLine; lineNumber++, previousLineExtraSpaces = extraSpaces) {
|
||||
extraSpaces = 0;
|
||||
let lineText = model.getLineContent(lineNumber);
|
||||
let indentationEndIndex = strings.firstNonWhitespaceIndex(lineText);
|
||||
|
||||
@@ -153,7 +153,7 @@ export class LanguageConfigurationChangeEvent {
|
||||
|
||||
export class LanguageConfigurationRegistryImpl {
|
||||
|
||||
private readonly _entries = new Map<LanguageId, RichEditSupport>();
|
||||
private readonly _entries = new Map<LanguageId, RichEditSupport | undefined>();
|
||||
|
||||
private readonly _onDidChange = new Emitter<LanguageConfigurationChangeEvent>();
|
||||
public readonly onDidChange: Event<LanguageConfigurationChangeEvent> = this._onDidChange.event;
|
||||
|
||||
@@ -66,7 +66,7 @@ export class RangesCollector {
|
||||
// reverse and create arrays of the exact length
|
||||
let startIndexes = new Uint32Array(this._length);
|
||||
let endIndexes = new Uint32Array(this._length);
|
||||
for (let i = this._length - 1, k = 0; i >= 0; i-- , k++) {
|
||||
for (let i = this._length - 1, k = 0; i >= 0; i--, k++) {
|
||||
startIndexes[k] = this._startIndexes[i];
|
||||
endIndexes[k] = this._endIndexes[i];
|
||||
}
|
||||
|
||||
@@ -240,8 +240,8 @@ export class MarkerController implements editorCommon.IEditorContribution {
|
||||
const prevMarkerKeybinding = this._keybindingService.lookupKeybinding(PrevMarkerAction.ID);
|
||||
const nextMarkerKeybinding = this._keybindingService.lookupKeybinding(NextMarkerAction.ID);
|
||||
const actions = [
|
||||
new Action(PrevMarkerAction.ID, PrevMarkerAction.LABEL + (prevMarkerKeybinding ? ` (${prevMarkerKeybinding.getLabel()})` : ''), 'show-previous-problem codicon-chevron-up', this._model.canNavigate(), async () => { if (this._model) { this._model.move(false, true); } }),
|
||||
new Action(NextMarkerAction.ID, NextMarkerAction.LABEL + (nextMarkerKeybinding ? ` (${nextMarkerKeybinding.getLabel()})` : ''), 'show-next-problem codicon-chevron-down', this._model.canNavigate(), async () => { if (this._model) { this._model.move(true, true); } })
|
||||
new Action(NextMarkerAction.ID, NextMarkerAction.LABEL + (nextMarkerKeybinding ? ` (${nextMarkerKeybinding.getLabel()})` : ''), 'show-next-problem codicon-chevron-down', this._model.canNavigate(), async () => { if (this._model) { this._model.move(true, true); } }),
|
||||
new Action(PrevMarkerAction.ID, PrevMarkerAction.LABEL + (prevMarkerKeybinding ? ` (${prevMarkerKeybinding.getLabel()})` : ''), 'show-previous-problem codicon-chevron-up', this._model.canNavigate(), async () => { if (this._model) { this._model.move(false, true); } })
|
||||
];
|
||||
this._widget = new MarkerNavigationWidget(this._editor, actions, this._themeService);
|
||||
this._widgetVisible.set(true);
|
||||
@@ -424,7 +424,7 @@ export class NextMarkerAction extends MarkerNavigationAction {
|
||||
label: NextMarkerAction.LABEL,
|
||||
alias: 'Go to Next Problem (Error, Warning, Info)',
|
||||
precondition: EditorContextKeys.writable,
|
||||
kbOpts: { kbExpr: EditorContextKeys.editorTextFocus, primary: KeyMod.Alt | KeyCode.F8, weight: KeybindingWeight.EditorContrib }
|
||||
kbOpts: { kbExpr: EditorContextKeys.focus, primary: KeyMod.Alt | KeyCode.F8, weight: KeybindingWeight.EditorContrib }
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -438,7 +438,7 @@ class PrevMarkerAction extends MarkerNavigationAction {
|
||||
label: PrevMarkerAction.LABEL,
|
||||
alias: 'Go to Previous Problem (Error, Warning, Info)',
|
||||
precondition: EditorContextKeys.writable,
|
||||
kbOpts: { kbExpr: EditorContextKeys.editorTextFocus, primary: KeyMod.Shift | KeyMod.Alt | KeyCode.F8, weight: KeybindingWeight.EditorContrib }
|
||||
kbOpts: { kbExpr: EditorContextKeys.focus, primary: KeyMod.Shift | KeyMod.Alt | KeyCode.F8, weight: KeybindingWeight.EditorContrib }
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@ export class MarkerNavigationWidget extends PeekViewWidget {
|
||||
|
||||
protected _fillHead(container: HTMLElement): void {
|
||||
super._fillHead(container);
|
||||
this._actionbarWidget!.push(this.actions, { label: false, icon: true });
|
||||
this._actionbarWidget!.push(this.actions, { label: false, icon: true, index: 0 });
|
||||
}
|
||||
|
||||
protected _fillTitleIcon(container: HTMLElement): void {
|
||||
@@ -237,7 +237,7 @@ export class MarkerNavigationWidget extends PeekViewWidget {
|
||||
|
||||
protected _getActionBarOptions(): IActionBarOptions {
|
||||
return {
|
||||
orientation: ActionsOrientation.HORIZONTAL_REVERSE
|
||||
orientation: ActionsOrientation.HORIZONTAL
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ export class RenameInputField implements IContentWidget, IDisposable {
|
||||
const border = theme.getColor(inputBorder);
|
||||
|
||||
this._inputField.style.backgroundColor = background ? background.toString() : '';
|
||||
this._inputField.style.color = foreground ? foreground.toString() : null;
|
||||
this._inputField.style.color = foreground ? foreground.toString() : '';
|
||||
|
||||
this._inputField.style.borderWidth = border ? '1px' : '0px';
|
||||
this._inputField.style.borderStyle = border ? 'solid' : 'none';
|
||||
|
||||
@@ -605,7 +605,7 @@ export class SnippetParser {
|
||||
|
||||
// fill in values for placeholders. the first placeholder of an index
|
||||
// that has a value defines the value for all placeholders with that index
|
||||
const placeholderDefaultValues = new Map<number, Marker[]>();
|
||||
const placeholderDefaultValues = new Map<number, Marker[] | undefined>();
|
||||
const incompletePlaceholders: Placeholder[] = [];
|
||||
let placeholderCount = 0;
|
||||
snippet.walk(marker => {
|
||||
|
||||
@@ -100,7 +100,12 @@ export class GlobalStorageDatabaseChannel extends Disposable implements IServerC
|
||||
|
||||
private serializeEvents(events: IStorageChangeEvent[]): ISerializableItemsChangeEvent {
|
||||
const items = new Map<Key, Value>();
|
||||
events.forEach(event => items.set(event.key, this.storageMainService.get(event.key)));
|
||||
events.forEach(event => {
|
||||
const existing = this.storageMainService.get(event.key);
|
||||
if (typeof existing === 'string') {
|
||||
items.set(event.key, existing);
|
||||
}
|
||||
});
|
||||
|
||||
return { items: mapToSerializable(items) };
|
||||
}
|
||||
|
||||
@@ -621,7 +621,10 @@ export class MainThreadTask implements MainThreadTaskShape {
|
||||
for (let i = 0; i < partiallyResolvedVars.length; i++) {
|
||||
const variableName = vars[i].substring(2, vars[i].length - 1);
|
||||
if (resolvedVars && values.variables[vars[i]] === vars[i]) {
|
||||
result.variables.set(variableName, resolvedVars.get(variableName));
|
||||
const resolved = resolvedVars.get(variableName);
|
||||
if (typeof resolved === 'string') {
|
||||
result.variables.set(variableName, resolved);
|
||||
}
|
||||
} else {
|
||||
result.variables.set(variableName, partiallyResolvedVars[i]);
|
||||
}
|
||||
|
||||
@@ -343,7 +343,7 @@ class TerminalDataEventTracker extends Disposable {
|
||||
) {
|
||||
super();
|
||||
|
||||
this._register(this._bufferer = new TerminalDataBufferer());
|
||||
this._register(this._bufferer = new TerminalDataBufferer(this._callback));
|
||||
|
||||
this._terminalService.terminalInstances.forEach(instance => this._registerInstance(instance));
|
||||
this._register(this._terminalService.onInstanceCreated(instance => this._registerInstance(instance)));
|
||||
@@ -352,6 +352,6 @@ class TerminalDataEventTracker extends Disposable {
|
||||
|
||||
private _registerInstance(instance: ITerminalInstance): void {
|
||||
// Buffer data events to reduce the amount of messages going to the extension host
|
||||
this._register(this._bufferer.startBuffering(instance.id, instance.onData, this._callback));
|
||||
this._register(this._bufferer.startBuffering(instance.id, instance.onData));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,8 +16,13 @@ import { equals } from 'vs/base/common/arrays';
|
||||
|
||||
const _modeId2WordDefinition = new Map<string, RegExp>();
|
||||
export function setWordDefinitionFor(modeId: string, wordDefinition: RegExp | undefined): void {
|
||||
_modeId2WordDefinition.set(modeId, wordDefinition);
|
||||
if (!wordDefinition) {
|
||||
_modeId2WordDefinition.delete(modeId);
|
||||
} else {
|
||||
_modeId2WordDefinition.set(modeId, wordDefinition);
|
||||
}
|
||||
}
|
||||
|
||||
export function getWordDefinitionFor(modeId: string): RegExp | undefined {
|
||||
return _modeId2WordDefinition.get(modeId);
|
||||
}
|
||||
|
||||
@@ -310,9 +310,8 @@ export abstract class BaseExtHostTerminalService implements IExtHostTerminalServ
|
||||
constructor(
|
||||
@IExtHostRpcService extHostRpc: IExtHostRpcService
|
||||
) {
|
||||
this._bufferer = new TerminalDataBufferer();
|
||||
|
||||
this._proxy = extHostRpc.getProxy(MainContext.MainThreadTerminalService);
|
||||
this._bufferer = new TerminalDataBufferer(this._proxy.$sendProcessData);
|
||||
this._onDidWriteTerminalData = new Emitter<vscode.TerminalDataWriteEvent>({
|
||||
onFirstListenerAdd: () => this._proxy.$startSendingDataEvents(),
|
||||
onLastListenerRemove: () => this._proxy.$stopSendingDataEvents()
|
||||
@@ -477,7 +476,7 @@ export abstract class BaseExtHostTerminalService implements IExtHostTerminalServ
|
||||
p.onProcessTitleChanged(title => this._proxy.$sendProcessTitle(id, title));
|
||||
|
||||
// Buffer data events to reduce the amount of messages going to the renderer
|
||||
this._bufferer.startBuffering(id, p.onProcessData, this._proxy.$sendProcessData);
|
||||
this._bufferer.startBuffering(id, p.onProcessData);
|
||||
p.onProcessExit(exitCode => this._onProcessExit(id, exitCode));
|
||||
|
||||
if (p.onProcessOverrideDimensions) {
|
||||
|
||||
@@ -91,6 +91,10 @@
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.monaco-workbench .activitybar > .content :not(.monaco-menu) > .monaco-action-bar .active-item-indicator {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.monaco-workbench.border .activitybar.right > .content :not(.monaco-menu) > .monaco-action-bar .active-item-indicator {
|
||||
left: -2px;
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ export class ActivityActionViewItem extends BaseActionViewItem {
|
||||
} else {
|
||||
const foreground = this._action.checked ? colors.activeForegroundColor : colors.inactiveForegroundColor;
|
||||
const borderBottomColor = this._action.checked ? colors.activeBorderBottomColor : null;
|
||||
this.label.style.color = foreground ? foreground.toString() : null;
|
||||
this.label.style.color = foreground ? foreground.toString() : '';
|
||||
this.label.style.borderBottomColor = borderBottomColor ? borderBottomColor.toString() : '';
|
||||
}
|
||||
}
|
||||
@@ -179,7 +179,7 @@ export class ActivityActionViewItem extends BaseActionViewItem {
|
||||
const badgeBackground = colors.badgeBackground;
|
||||
const contrastBorderColor = theme.getColor(contrastBorder);
|
||||
|
||||
this.badgeContent.style.color = badgeForeground ? badgeForeground.toString() : null;
|
||||
this.badgeContent.style.color = badgeForeground ? badgeForeground.toString() : '';
|
||||
this.badgeContent.style.backgroundColor = badgeBackground ? badgeBackground.toString() : '';
|
||||
|
||||
this.badgeContent.style.borderStyle = contrastBorderColor ? 'solid' : '';
|
||||
|
||||
@@ -411,7 +411,7 @@ export abstract class CompositePart<T extends Composite> extends Part {
|
||||
},
|
||||
|
||||
updateStyles: () => {
|
||||
titleLabel.style.color = $this.titleForegroundColor ? $this.getColor($this.titleForegroundColor) : null;
|
||||
titleLabel.style.color = $this.titleForegroundColor ? $this.getColor($this.titleForegroundColor) || '' : '';
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -275,9 +275,9 @@ export class NoTabsTitleControl extends TitleControl {
|
||||
|
||||
editorLabel.setResource({ name, description, resource }, { title: typeof title === 'string' ? title : undefined, italic: !isEditorPinned, extraClasses: ['no-tabs', 'title-label'] });
|
||||
if (isGroupActive) {
|
||||
editorLabel.element.style.color = this.getColor(TAB_ACTIVE_FOREGROUND);
|
||||
editorLabel.element.style.color = this.getColor(TAB_ACTIVE_FOREGROUND) || '';
|
||||
} else {
|
||||
editorLabel.element.style.color = this.getColor(TAB_UNFOCUSED_ACTIVE_FOREGROUND);
|
||||
editorLabel.element.style.color = this.getColor(TAB_UNFOCUSED_ACTIVE_FOREGROUND) || '';
|
||||
}
|
||||
|
||||
// Update Editor Actions Toolbar
|
||||
|
||||
@@ -981,7 +981,7 @@ export class TabsTitleControl extends TitleControl {
|
||||
}
|
||||
|
||||
// Label
|
||||
tabLabelWidget.element.style.color = this.getColor(isGroupActive ? TAB_ACTIVE_FOREGROUND : TAB_UNFOCUSED_ACTIVE_FOREGROUND);
|
||||
tabLabelWidget.element.style.color = this.getColor(isGroupActive ? TAB_ACTIVE_FOREGROUND : TAB_UNFOCUSED_ACTIVE_FOREGROUND) || '';
|
||||
}
|
||||
|
||||
// Tab is inactive
|
||||
@@ -994,7 +994,7 @@ export class TabsTitleControl extends TitleControl {
|
||||
tabContainer.style.boxShadow = '';
|
||||
|
||||
// Label
|
||||
tabLabelWidget.element.style.color = this.getColor(isGroupActive ? TAB_INACTIVE_FOREGROUND : TAB_UNFOCUSED_INACTIVE_FOREGROUND);
|
||||
tabLabelWidget.element.style.color = this.getColor(isGroupActive ? TAB_INACTIVE_FOREGROUND : TAB_UNFOCUSED_INACTIVE_FOREGROUND) || '';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -236,7 +236,7 @@ export class NotificationsCenter extends Themable {
|
||||
this.notificationsCenterContainer.style.border = borderColor ? `1px solid ${borderColor}` : '';
|
||||
|
||||
const headerForeground = this.getColor(NOTIFICATIONS_CENTER_HEADER_FOREGROUND);
|
||||
this.notificationsCenterHeader.style.color = headerForeground ? headerForeground.toString() : null;
|
||||
this.notificationsCenterHeader.style.color = headerForeground ? headerForeground.toString() : '';
|
||||
|
||||
const headerBackground = this.getColor(NOTIFICATIONS_CENTER_HEADER_BACKGROUND);
|
||||
this.notificationsCenterHeader.style.background = headerBackground ? headerBackground.toString() : '';
|
||||
|
||||
@@ -221,7 +221,7 @@ export class NotificationsList extends Themable {
|
||||
protected updateStyles(): void {
|
||||
if (this.listContainer) {
|
||||
const foreground = this.getColor(NOTIFICATIONS_FOREGROUND);
|
||||
this.listContainer.style.color = foreground ? foreground : null;
|
||||
this.listContainer.style.color = foreground ? foreground : '';
|
||||
|
||||
const background = this.getColor(NOTIFICATIONS_BACKGROUND);
|
||||
this.listContainer.style.background = background ? background : '';
|
||||
|
||||
@@ -525,7 +525,7 @@ export class NotificationsToasts extends Themable {
|
||||
|
||||
// Hide or show toast based on context
|
||||
this.setVisibility(toast, makeVisible);
|
||||
toast.container.style.opacity = null;
|
||||
toast.container.style.opacity = '';
|
||||
|
||||
if (makeVisible) {
|
||||
visibleToasts++;
|
||||
|
||||
@@ -1542,7 +1542,7 @@ export class QuickInputService extends Component implements IQuickInputService {
|
||||
const quickInputBackground = theme.getColor(QUICK_INPUT_BACKGROUND);
|
||||
this.ui.container.style.backgroundColor = quickInputBackground ? quickInputBackground.toString() : '';
|
||||
const quickInputForeground = theme.getColor(QUICK_INPUT_FOREGROUND);
|
||||
this.ui.container.style.color = quickInputForeground ? quickInputForeground.toString() : null;
|
||||
this.ui.container.style.color = quickInputForeground ? quickInputForeground.toString() : '';
|
||||
const contrastBorderColor = theme.getColor(contrastBorder);
|
||||
this.ui.container.style.border = contrastBorderColor ? `1px solid ${contrastBorderColor}` : '';
|
||||
const widgetShadowColor = theme.getColor(widgetShadow);
|
||||
|
||||
@@ -173,7 +173,7 @@ export class SidebarPart extends CompositePart<Viewlet> implements IViewletServi
|
||||
const container = assertIsDefined(this.getContainer());
|
||||
|
||||
container.style.backgroundColor = this.getColor(SIDE_BAR_BACKGROUND) || '';
|
||||
container.style.color = this.getColor(SIDE_BAR_FOREGROUND);
|
||||
container.style.color = this.getColor(SIDE_BAR_FOREGROUND) || '';
|
||||
|
||||
const borderColor = this.getColor(SIDE_BAR_BORDER) || this.getColor(contrastBorder);
|
||||
const isPositionLeft = this.layoutService.getSideBarPosition() === SideBarPosition.LEFT;
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
.monaco-workbench .part.statusbar > .items-container > .statusbar-item.has-beak:before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: calc(50% - 9px); /* 3px (margin) + 5px (padding) + 1px (icon) = 9px */
|
||||
left: 10px;
|
||||
top: -5px;
|
||||
border-bottom-width: 5px;
|
||||
border-bottom-style: solid;
|
||||
|
||||
@@ -589,7 +589,7 @@ export class StatusbarPart extends Part implements IStatusbarService {
|
||||
// Background colors
|
||||
const backgroundColor = this.getColor(this.contextService.getWorkbenchState() !== WorkbenchState.EMPTY ? STATUS_BAR_BACKGROUND : STATUS_BAR_NO_FOLDER_BACKGROUND) || '';
|
||||
container.style.backgroundColor = backgroundColor;
|
||||
container.style.color = this.getColor(this.contextService.getWorkbenchState() !== WorkbenchState.EMPTY ? STATUS_BAR_FOREGROUND : STATUS_BAR_NO_FOLDER_FOREGROUND);
|
||||
container.style.color = this.getColor(this.contextService.getWorkbenchState() !== WorkbenchState.EMPTY ? STATUS_BAR_FOREGROUND : STATUS_BAR_NO_FOLDER_FOREGROUND) || '';
|
||||
|
||||
// Border color
|
||||
const borderColor = this.getColor(this.contextService.getWorkbenchState() !== WorkbenchState.EMPTY ? STATUS_BAR_BORDER : STATUS_BAR_NO_FOLDER_BORDER) || this.getColor(contrastBorder);
|
||||
@@ -795,7 +795,7 @@ class StatusbarEntryItem extends Disposable {
|
||||
if (isBackground) {
|
||||
container.style.backgroundColor = colorResult || '';
|
||||
} else {
|
||||
container.style.color = colorResult;
|
||||
container.style.color = colorResult || '';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -517,7 +517,7 @@ export class TitlebarPart extends Part implements ITitleService {
|
||||
}
|
||||
|
||||
const titleForeground = this.getColor(this.isInactive ? TITLE_BAR_INACTIVE_FOREGROUND : TITLE_BAR_ACTIVE_FOREGROUND);
|
||||
this.element.style.color = titleForeground;
|
||||
this.element.style.color = titleForeground || '';
|
||||
|
||||
const titleBorder = this.getColor(TITLE_BAR_BORDER);
|
||||
this.element.style.borderBottom = titleBorder ? `1px solid ${titleBorder}` : '';
|
||||
|
||||
+2
-2
@@ -226,8 +226,8 @@ export class SuggestEnabledInput extends Widget implements IThemable {
|
||||
public style(colors: ISuggestEnabledInputStyles): void {
|
||||
this.placeholderText.style.backgroundColor =
|
||||
this.stylingContainer.style.backgroundColor = colors.inputBackground ? colors.inputBackground.toString() : '';
|
||||
this.stylingContainer.style.color = colors.inputForeground ? colors.inputForeground.toString() : null;
|
||||
this.placeholderText.style.color = colors.inputPlaceholderForeground ? colors.inputPlaceholderForeground.toString() : null;
|
||||
this.stylingContainer.style.color = colors.inputForeground ? colors.inputForeground.toString() : '';
|
||||
this.placeholderText.style.color = colors.inputPlaceholderForeground ? colors.inputPlaceholderForeground.toString() : '';
|
||||
|
||||
this.stylingContainer.style.borderWidth = '1px';
|
||||
this.stylingContainer.style.borderStyle = 'solid';
|
||||
|
||||
@@ -93,7 +93,7 @@ export class CallStackView extends ViewPane {
|
||||
if (thread && thread.stoppedDetails) {
|
||||
this.pauseMessageLabel.textContent = thread.stoppedDetails.description || nls.localize('debugStopped', "Paused on {0}", thread.stoppedDetails.reason || '');
|
||||
this.pauseMessageLabel.title = thread.stoppedDetails.text || '';
|
||||
this.pauseMessageLabel.toggleAttribute('exception', thread.stoppedDetails.reason === 'exception');
|
||||
dom.toggleClass(this.pauseMessageLabel, 'exception', thread.stoppedDetails.reason === 'exception');
|
||||
this.pauseMessage.hidden = false;
|
||||
if (this.toolbar) {
|
||||
this.toolbar.setActions([])();
|
||||
@@ -511,11 +511,11 @@ class StackFramesRenderer implements ITreeRenderer<IStackFrame, FuzzyScore, ISta
|
||||
|
||||
renderElement(element: ITreeNode<IStackFrame, FuzzyScore>, index: number, data: IStackFrameTemplateData): void {
|
||||
const stackFrame = element.element;
|
||||
data.stackFrame.toggleAttribute('disabled', !stackFrame.source || !stackFrame.source.available || isDeemphasized(stackFrame));
|
||||
data.stackFrame.toggleAttribute('label', stackFrame.presentationHint === 'label');
|
||||
data.stackFrame.toggleAttribute('subtle', stackFrame.presentationHint === 'subtle');
|
||||
dom.toggleClass(data.stackFrame, 'disabled', !stackFrame.source || !stackFrame.source.available || isDeemphasized(stackFrame));
|
||||
dom.toggleClass(data.stackFrame, 'label', stackFrame.presentationHint === 'label');
|
||||
dom.toggleClass(data.stackFrame, 'subtle', stackFrame.presentationHint === 'subtle');
|
||||
const hasActions = !!stackFrame.thread.session.capabilities.supportsRestartFrame && stackFrame.presentationHint !== 'label' && stackFrame.presentationHint !== 'subtle';
|
||||
data.stackFrame.toggleAttribute('has-actions', hasActions);
|
||||
dom.toggleClass(data.stackFrame, 'has-actions', hasActions);
|
||||
|
||||
data.file.title = stackFrame.source.inMemory ? stackFrame.source.uri.path : this.labelService.getUriLabel(stackFrame.source.uri);
|
||||
if (stackFrame.source.raw.origin) {
|
||||
|
||||
@@ -107,7 +107,7 @@ export class DebugHoverWidget implements IContentWidget {
|
||||
if (colors.editorHoverForeground) {
|
||||
this.domNode.style.color = colors.editorHoverForeground.toString();
|
||||
} else {
|
||||
this.domNode.style.color = null;
|
||||
this.domNode.style.color = '';
|
||||
}
|
||||
}));
|
||||
this.toDispose.push(this.tree.onDidChangeContentHeight(() => this.layoutTreeAndContainer()));
|
||||
|
||||
@@ -380,16 +380,20 @@ export class DebugService implements IDebugService {
|
||||
if (configByProviders && configByProviders.type) {
|
||||
try {
|
||||
let resolvedConfig = await this.substituteVariables(launch, configByProviders);
|
||||
|
||||
if (!resolvedConfig) {
|
||||
// User canceled resolving of interactive variables, silently return
|
||||
// User cancelled resolving of interactive variables, silently return
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!this.initCancellationToken) {
|
||||
// User cancelled, silently return
|
||||
return false;
|
||||
}
|
||||
|
||||
const cfg = await this.configurationManager.resolveDebugConfigurationWithSubstitutedVariables(launch && launch.workspace ? launch.workspace.uri : undefined, type, resolvedConfig, this.initCancellationToken.token);
|
||||
if (!cfg) {
|
||||
if (launch && type && cfg === null) { // show launch.json only for "config" being "null".
|
||||
await launch.openConfigFile(false, true, type, this.initCancellationToken ? this.initCancellationToken.token : undefined);
|
||||
if (launch && type && cfg === null && this.initCancellationToken) { // show launch.json only for "config" being "null".
|
||||
await launch.openConfigFile(false, true, type, this.initCancellationToken.token);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -422,16 +426,16 @@ export class DebugService implements IDebugService {
|
||||
} else if (this.contextService.getWorkbenchState() === WorkbenchState.EMPTY) {
|
||||
await this.showError(nls.localize('noFolderWorkspaceDebugError', "The active file can not be debugged. Make sure it is saved and that you have a debug extension installed for that file type."));
|
||||
}
|
||||
if (launch) {
|
||||
await launch.openConfigFile(false, true, undefined, this.initCancellationToken ? this.initCancellationToken.token : undefined);
|
||||
if (launch && this.initCancellationToken) {
|
||||
await launch.openConfigFile(false, true, undefined, this.initCancellationToken.token);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (launch && type && configByProviders === null) { // show launch.json only for "config" being "null".
|
||||
await launch.openConfigFile(false, true, type, this.initCancellationToken ? this.initCancellationToken.token : undefined);
|
||||
if (launch && type && configByProviders === null && this.initCancellationToken) { // show launch.json only for "config" being "null".
|
||||
await launch.openConfigFile(false, true, type, this.initCancellationToken.token);
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -648,7 +652,7 @@ export class DebugService implements IDebugService {
|
||||
const resolvedByProviders = await this.configurationManager.resolveConfigurationByProviders(launch.workspace ? launch.workspace.uri : undefined, unresolved.type, unresolved, this.initCancellationToken.token);
|
||||
if (resolvedByProviders) {
|
||||
resolved = await this.substituteVariables(launch, resolvedByProviders);
|
||||
if (resolved) {
|
||||
if (resolved && this.initCancellationToken) {
|
||||
resolved = await this.configurationManager.resolveDebugConfigurationWithSubstitutedVariables(launch && launch.workspace ? launch.workspace.uri : undefined, unresolved.type, resolved, this.initCancellationToken.token);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -67,7 +67,7 @@ export class StatusBarColorProvider extends Themable implements IWorkbenchContri
|
||||
// Container Colors
|
||||
const backgroundColor = this.getColor(this.getColorKey(STATUS_BAR_NO_FOLDER_BACKGROUND, STATUS_BAR_DEBUGGING_BACKGROUND, STATUS_BAR_BACKGROUND));
|
||||
container.style.backgroundColor = backgroundColor || '';
|
||||
container.style.color = this.getColor(this.getColorKey(STATUS_BAR_NO_FOLDER_FOREGROUND, STATUS_BAR_DEBUGGING_FOREGROUND, STATUS_BAR_FOREGROUND));
|
||||
container.style.color = this.getColor(this.getColorKey(STATUS_BAR_NO_FOLDER_FOREGROUND, STATUS_BAR_DEBUGGING_FOREGROUND, STATUS_BAR_FOREGROUND)) || '';
|
||||
|
||||
// Border Color
|
||||
const borderColor = this.getColor(this.getColorKey(STATUS_BAR_NO_FOLDER_BORDER, STATUS_BAR_DEBUGGING_BORDER, STATUS_BAR_BORDER)) || this.getColor(contrastBorder);
|
||||
|
||||
@@ -277,12 +277,12 @@ export class FeedbackDropdown extends Dropdown {
|
||||
disposables.add(attachStylerCallback(this.themeService, { widgetShadow, editorWidgetBackground, editorWidgetForeground, inputBackground, inputForeground, inputBorder, editorBackground, contrastBorder }, colors => {
|
||||
if (this.feedbackForm) {
|
||||
this.feedbackForm.style.backgroundColor = colors.editorWidgetBackground ? colors.editorWidgetBackground.toString() : '';
|
||||
this.feedbackForm.style.color = colors.editorWidgetForeground ? colors.editorWidgetForeground.toString() : null;
|
||||
this.feedbackForm.style.color = colors.editorWidgetForeground ? colors.editorWidgetForeground.toString() : '';
|
||||
this.feedbackForm.style.boxShadow = colors.widgetShadow ? `0 0 8px ${colors.widgetShadow}` : '';
|
||||
}
|
||||
if (this.feedbackDescriptionInput) {
|
||||
this.feedbackDescriptionInput.style.backgroundColor = colors.inputBackground ? colors.inputBackground.toString() : '';
|
||||
this.feedbackDescriptionInput.style.color = colors.inputForeground ? colors.inputForeground.toString() : null;
|
||||
this.feedbackDescriptionInput.style.color = colors.inputForeground ? colors.inputForeground.toString() : '';
|
||||
this.feedbackDescriptionInput.style.border = `1px solid ${colors.inputBorder || 'transparent'}`;
|
||||
}
|
||||
|
||||
|
||||
@@ -95,6 +95,7 @@ export class FeedbackStatusbarConribution extends Disposable implements IWorkben
|
||||
private getStatusEntry(showBeak?: boolean): IStatusbarEntry {
|
||||
return {
|
||||
text: '$(feedback)',
|
||||
tooltip: localize('status.feedback', "Tweet Feedback"),
|
||||
command: '_feedback.open',
|
||||
showBeak
|
||||
};
|
||||
|
||||
@@ -700,7 +700,7 @@ export class ExplorerView extends ViewPane {
|
||||
if (Array.isArray(treeInput)) {
|
||||
if (hasExpandedRootChild(this.tree, treeInput)) {
|
||||
treeInput.forEach(folder => {
|
||||
folder.children.forEach(child => this.tree.hasNode(child) && this.tree.collapse(child));
|
||||
folder.children.forEach(child => this.tree.hasNode(child) && this.tree.collapse(child, true));
|
||||
});
|
||||
|
||||
return;
|
||||
|
||||
@@ -188,7 +188,7 @@ export class DefineKeybindingWidget extends Widget {
|
||||
if (colors.editorWidgetForeground) {
|
||||
this._domNode.domNode.style.color = colors.editorWidgetForeground.toString();
|
||||
} else {
|
||||
this._domNode.domNode.style.color = null;
|
||||
this._domNode.domNode.style.color = '';
|
||||
}
|
||||
|
||||
if (colors.widgetShadow) {
|
||||
|
||||
@@ -410,7 +410,7 @@ export class KeybindingsEditor extends BaseEditor implements IKeybindingsEditor
|
||||
recordingBadge.style.borderWidth = border ? '1px' : '';
|
||||
recordingBadge.style.borderStyle = border ? 'solid' : '';
|
||||
recordingBadge.style.borderColor = border;
|
||||
recordingBadge.style.color = color ? color.toString() : null;
|
||||
recordingBadge.style.color = color ? color.toString() : '';
|
||||
}));
|
||||
return recordingBadge;
|
||||
}
|
||||
|
||||
@@ -643,7 +643,7 @@ export class SearchWidget extends Widget {
|
||||
this.countElement.style.borderColor = border;
|
||||
|
||||
const color = this.themeService.getTheme().getColor(badgeForeground);
|
||||
this.countElement.style.color = color ? color.toString() : null;
|
||||
this.countElement.style.color = color ? color.toString() : '';
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -533,7 +533,7 @@ export class SettingsEditor2 extends BaseEditor {
|
||||
DOM.append(this.noResultsMessage, this.clearFilterLinkContainer);
|
||||
|
||||
this._register(attachStylerCallback(this.themeService, { editorForeground }, colors => {
|
||||
this.noResultsMessage.style.color = colors.editorForeground ? colors.editorForeground.toString() : null;
|
||||
this.noResultsMessage.style.color = colors.editorForeground ? colors.editorForeground.toString() : '';
|
||||
}));
|
||||
|
||||
this.createTOC(bodyContainer);
|
||||
|
||||
@@ -22,6 +22,7 @@ import { registerThemingParticipant } from 'vs/platform/theme/common/themeServic
|
||||
import { searchEditorFindMatch, searchEditorFindMatchBorder } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { UntitledTextEditorInput } from 'vs/workbench/common/editor/untitledTextEditorInput';
|
||||
import { localize } from 'vs/nls';
|
||||
import { isCodeEditor } from 'vs/editor/browser/editorBrowser';
|
||||
|
||||
// Using \r\n on Windows inserts an extra newline between results.
|
||||
const lineDelimiter = '\n';
|
||||
@@ -234,10 +235,13 @@ const serializeSearchResultForEditor = (searchResult: SearchResult, rawIncludePa
|
||||
|
||||
export const refreshActiveEditorSearch =
|
||||
async (contextLines: number | undefined, editorService: IEditorService, instantiationService: IInstantiationService, contextService: IWorkspaceContextService, labelService: ILabelService, configurationService: IConfigurationService) => {
|
||||
const model = editorService.activeTextEditorWidget?.getModel();
|
||||
if (!model) { return; }
|
||||
const editorWidget = editorService.activeTextEditorWidget;
|
||||
if (!isCodeEditor(editorWidget)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const textModel = model as ITextModel;
|
||||
const textModel = editorWidget.getModel();
|
||||
if (!textModel) { return; }
|
||||
|
||||
const header = textModel.getValueInRange(new Range(1, 1, 5, 1), EndOfLinePreference.LF)
|
||||
.split(lineDelimiter)
|
||||
|
||||
@@ -879,7 +879,7 @@ export class SearchView extends ViewPane {
|
||||
}
|
||||
this.searchWidget.setValue(selectedText, true);
|
||||
updatedText = true;
|
||||
this.onQueryChanged(false);
|
||||
if (this.searchConfig.searchOnType) { this.onQueryChanged(false); }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -100,6 +100,7 @@ export class TerminalPanel extends Panel {
|
||||
if (this._terminalService.terminalInstances.length > 0) {
|
||||
this._updateFont();
|
||||
this._updateTheme();
|
||||
this._terminalService.getActiveTab()?.setVisible(visible);
|
||||
} else {
|
||||
// Check if instances were already restored as part of workbench restore
|
||||
if (this._terminalService.terminalInstances.length === 0) {
|
||||
|
||||
@@ -14,13 +14,16 @@ interface TerminalDataBuffer extends IDisposable {
|
||||
export class TerminalDataBufferer implements IDisposable {
|
||||
private readonly _terminalBufferMap = new Map<number, TerminalDataBuffer>();
|
||||
|
||||
constructor(private readonly _callback: (id: number, data: string) => void) {
|
||||
}
|
||||
|
||||
dispose() {
|
||||
for (const buffer of this._terminalBufferMap.values()) {
|
||||
buffer.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
startBuffering(id: number, event: Event<string>, callback: (id: number, data: string) => void, throttleBy: number = 5): IDisposable {
|
||||
startBuffering(id: number, event: Event<string>, throttleBy: number = 5): IDisposable {
|
||||
let disposable: IDisposable;
|
||||
disposable = event((e: string) => {
|
||||
let buffer = this._terminalBufferMap.get(id);
|
||||
@@ -30,16 +33,13 @@ export class TerminalDataBufferer implements IDisposable {
|
||||
return;
|
||||
}
|
||||
|
||||
const timeoutId = setTimeout(() => {
|
||||
this._terminalBufferMap.delete(id);
|
||||
callback(id, buffer!.data.join(''));
|
||||
}, throttleBy);
|
||||
const timeoutId = setTimeout(() => this._flushBuffer(id), throttleBy);
|
||||
buffer = {
|
||||
data: [e],
|
||||
timeoutId: timeoutId,
|
||||
dispose: () => {
|
||||
clearTimeout(timeoutId);
|
||||
this._terminalBufferMap.delete(id);
|
||||
this._flushBuffer(id);
|
||||
disposable.dispose();
|
||||
}
|
||||
};
|
||||
@@ -54,4 +54,12 @@ export class TerminalDataBufferer implements IDisposable {
|
||||
buffer.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
private _flushBuffer(id: number): void {
|
||||
const buffer = this._terminalBufferMap.get(id);
|
||||
if (buffer) {
|
||||
this._terminalBufferMap.delete(id);
|
||||
this._callback(id, buffer.data.join(''));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,20 +11,28 @@ const wait = (ms: number) => new Promise(resolve => setTimeout(resolve, ms));
|
||||
|
||||
suite('Workbench - TerminalDataBufferer', () => {
|
||||
let bufferer: TerminalDataBufferer;
|
||||
let counter: { [id: number]: number };
|
||||
let data: { [id: number]: string };
|
||||
|
||||
setup(async () => {
|
||||
bufferer = new TerminalDataBufferer();
|
||||
counter = {};
|
||||
data = {};
|
||||
bufferer = new TerminalDataBufferer((id, e) => {
|
||||
if (!(id in counter)) {
|
||||
counter[id] = 0;
|
||||
}
|
||||
counter[id]++;
|
||||
if (!(id in data)) {
|
||||
data[id] = '';
|
||||
}
|
||||
data[id] = e;
|
||||
});
|
||||
});
|
||||
|
||||
test('start', async () => {
|
||||
let terminalOnData = new Emitter<string>();
|
||||
let counter = 0;
|
||||
let data: string | undefined;
|
||||
const terminalOnData = new Emitter<string>();
|
||||
|
||||
bufferer.startBuffering(1, terminalOnData.event, (id, e) => {
|
||||
counter++;
|
||||
data = e;
|
||||
}, 0);
|
||||
bufferer.startBuffering(1, terminalOnData.event, 0);
|
||||
|
||||
terminalOnData.fire('1');
|
||||
terminalOnData.fire('2');
|
||||
@@ -34,33 +42,21 @@ suite('Workbench - TerminalDataBufferer', () => {
|
||||
|
||||
terminalOnData.fire('4');
|
||||
|
||||
assert.equal(counter, 1);
|
||||
assert.equal(data, '123');
|
||||
assert.equal(counter[1], 1);
|
||||
assert.equal(data[1], '123');
|
||||
|
||||
await wait(0);
|
||||
|
||||
assert.equal(counter, 2);
|
||||
assert.equal(data, '4');
|
||||
assert.equal(counter[1], 2);
|
||||
assert.equal(data[1], '4');
|
||||
});
|
||||
|
||||
test('start 2', async () => {
|
||||
let terminal1OnData = new Emitter<string>();
|
||||
let terminal1Counter = 0;
|
||||
let terminal1Data: string | undefined;
|
||||
const terminal1OnData = new Emitter<string>();
|
||||
const terminal2OnData = new Emitter<string>();
|
||||
|
||||
bufferer.startBuffering(1, terminal1OnData.event, (id, e) => {
|
||||
terminal1Counter++;
|
||||
terminal1Data = e;
|
||||
}, 0);
|
||||
|
||||
let terminal2OnData = new Emitter<string>();
|
||||
let terminal2Counter = 0;
|
||||
let terminal2Data: string | undefined;
|
||||
|
||||
bufferer.startBuffering(2, terminal2OnData.event, (id, e) => {
|
||||
terminal2Counter++;
|
||||
terminal2Data = e;
|
||||
}, 0);
|
||||
bufferer.startBuffering(1, terminal1OnData.event, 0);
|
||||
bufferer.startBuffering(2, terminal2OnData.event, 0);
|
||||
|
||||
terminal1OnData.fire('1');
|
||||
terminal2OnData.fire('4');
|
||||
@@ -70,60 +66,41 @@ suite('Workbench - TerminalDataBufferer', () => {
|
||||
terminal2OnData.fire('6');
|
||||
terminal2OnData.fire('7');
|
||||
|
||||
assert.equal(terminal1Counter, 0);
|
||||
assert.equal(terminal1Data, undefined);
|
||||
assert.equal(terminal2Counter, 0);
|
||||
assert.equal(terminal2Data, undefined);
|
||||
assert.equal(counter[1], undefined);
|
||||
assert.equal(data[1], undefined);
|
||||
assert.equal(counter[2], undefined);
|
||||
assert.equal(data[2], undefined);
|
||||
|
||||
await wait(0);
|
||||
|
||||
assert.equal(terminal1Counter, 1);
|
||||
assert.equal(terminal1Data, '123');
|
||||
assert.equal(terminal2Counter, 1);
|
||||
assert.equal(terminal2Data, '4567');
|
||||
assert.equal(counter[1], 1);
|
||||
assert.equal(data[1], '123');
|
||||
assert.equal(counter[2], 1);
|
||||
assert.equal(data[2], '4567');
|
||||
});
|
||||
|
||||
test('stop', async () => {
|
||||
let terminalOnData = new Emitter<string>();
|
||||
let counter = 0;
|
||||
let data: string | undefined;
|
||||
|
||||
bufferer.startBuffering(1, terminalOnData.event, (id, e) => {
|
||||
counter++;
|
||||
data = e;
|
||||
}, 0);
|
||||
bufferer.startBuffering(1, terminalOnData.event, 0);
|
||||
|
||||
terminalOnData.fire('1');
|
||||
terminalOnData.fire('2');
|
||||
terminalOnData.fire('3');
|
||||
|
||||
bufferer.stopBuffering(1);
|
||||
|
||||
await wait(0);
|
||||
|
||||
assert.equal(counter, 0);
|
||||
assert.equal(data, undefined);
|
||||
assert.equal(counter[1], 1);
|
||||
assert.equal(data[1], '123');
|
||||
});
|
||||
|
||||
test('start 2 stop 1', async () => {
|
||||
let terminal1OnData = new Emitter<string>();
|
||||
let terminal1Counter = 0;
|
||||
let terminal1Data: string | undefined;
|
||||
|
||||
bufferer.startBuffering(1, terminal1OnData.event, (id, e) => {
|
||||
terminal1Counter++;
|
||||
terminal1Data = e;
|
||||
}, 0);
|
||||
|
||||
let terminal2OnData = new Emitter<string>();
|
||||
let terminal2Counter = 0;
|
||||
let terminal2Data: string | undefined;
|
||||
|
||||
bufferer.startBuffering(2, terminal2OnData.event, (id, e) => {
|
||||
terminal2Counter++;
|
||||
terminal2Data = e;
|
||||
}, 0);
|
||||
const terminal1OnData = new Emitter<string>();
|
||||
const terminal2OnData = new Emitter<string>();
|
||||
|
||||
bufferer.startBuffering(1, terminal1OnData.event, 0);
|
||||
bufferer.startBuffering(2, terminal2OnData.event, 0);
|
||||
|
||||
terminal1OnData.fire('1');
|
||||
terminal2OnData.fire('4');
|
||||
@@ -133,39 +110,26 @@ suite('Workbench - TerminalDataBufferer', () => {
|
||||
terminal2OnData.fire('6');
|
||||
terminal2OnData.fire('7');
|
||||
|
||||
assert.equal(terminal1Counter, 0);
|
||||
assert.equal(terminal1Data, undefined);
|
||||
assert.equal(terminal2Counter, 0);
|
||||
assert.equal(terminal2Data, undefined);
|
||||
assert.equal(counter[1], undefined);
|
||||
assert.equal(data[1], undefined);
|
||||
assert.equal(counter[2], undefined);
|
||||
assert.equal(data[2], undefined);
|
||||
|
||||
bufferer.stopBuffering(1);
|
||||
await wait(0);
|
||||
|
||||
assert.equal(terminal1Counter, 0);
|
||||
assert.equal(terminal1Data, undefined);
|
||||
assert.equal(terminal2Counter, 1);
|
||||
assert.equal(terminal2Data, '4567');
|
||||
assert.equal(counter[1], 1);
|
||||
assert.equal(data[1], '123');
|
||||
assert.equal(counter[2], 1);
|
||||
assert.equal(data[2], '4567');
|
||||
});
|
||||
|
||||
test('dispose', async () => {
|
||||
let terminal1OnData = new Emitter<string>();
|
||||
let terminal1Counter = 0;
|
||||
let terminal1Data: string | undefined;
|
||||
|
||||
bufferer.startBuffering(1, terminal1OnData.event, (id, e) => {
|
||||
terminal1Counter++;
|
||||
terminal1Data = e;
|
||||
}, 0);
|
||||
|
||||
let terminal2OnData = new Emitter<string>();
|
||||
let terminal2Counter = 0;
|
||||
let terminal2Data: string | undefined;
|
||||
|
||||
bufferer.startBuffering(2, terminal2OnData.event, (id, e) => {
|
||||
terminal2Counter++;
|
||||
terminal2Data = e;
|
||||
}, 0);
|
||||
test('dispose should flush remaining data events', async () => {
|
||||
const terminal1OnData = new Emitter<string>();
|
||||
const terminal2OnData = new Emitter<string>();
|
||||
|
||||
bufferer.startBuffering(1, terminal1OnData.event, 0);
|
||||
bufferer.startBuffering(2, terminal2OnData.event, 0);
|
||||
|
||||
terminal1OnData.fire('1');
|
||||
terminal2OnData.fire('4');
|
||||
@@ -175,17 +139,17 @@ suite('Workbench - TerminalDataBufferer', () => {
|
||||
terminal2OnData.fire('6');
|
||||
terminal2OnData.fire('7');
|
||||
|
||||
assert.equal(terminal1Counter, 0);
|
||||
assert.equal(terminal1Data, undefined);
|
||||
assert.equal(terminal2Counter, 0);
|
||||
assert.equal(terminal2Data, undefined);
|
||||
assert.equal(counter[1], undefined);
|
||||
assert.equal(data[1], undefined);
|
||||
assert.equal(counter[2], undefined);
|
||||
assert.equal(data[2], undefined);
|
||||
|
||||
bufferer.dispose();
|
||||
await wait(0);
|
||||
|
||||
assert.equal(terminal1Counter, 0);
|
||||
assert.equal(terminal1Data, undefined);
|
||||
assert.equal(terminal2Counter, 0);
|
||||
assert.equal(terminal2Data, undefined);
|
||||
assert.equal(counter[1], 1);
|
||||
assert.equal(data[1], '123');
|
||||
assert.equal(counter[2], 1);
|
||||
assert.equal(data[2], '4567');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -9180,16 +9180,16 @@ typescript-formatter@7.1.0:
|
||||
commandpost "^1.0.0"
|
||||
editorconfig "^0.15.0"
|
||||
|
||||
typescript@3.7.3:
|
||||
version "3.7.3"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.3.tgz#b36840668a16458a7025b9eabfad11b66ab85c69"
|
||||
integrity sha512-Mcr/Qk7hXqFBXMN7p7Lusj1ktCBydylfQM/FZCk5glCNQJrCUKPkMHdo9R0MTFWsC/4kPFvDS0fDPvukfCkFsw==
|
||||
|
||||
typescript@^2.6.2:
|
||||
version "2.6.2"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.6.2.tgz#3c5b6fd7f6de0914269027f03c0946758f7673a4"
|
||||
integrity sha1-PFtv1/beCRQmkCfwPAlGdY92c6Q=
|
||||
|
||||
typescript@^3.8.0-dev.20200104:
|
||||
version "3.8.0-dev.20200104"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.0-dev.20200104.tgz#521b2f0b5a288b6e3f8a095525f64712330cc649"
|
||||
integrity sha512-Zdb8X1uzvUPrRvRBqega83NxqCuN/kyxuXG1u8BV10mGOqfwQb0SreSDoDDM1zUgrqFZ93neVh3DVyWTvx6XlA==
|
||||
|
||||
uc.micro@^1.0.1, uc.micro@^1.0.3:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.3.tgz#7ed50d5e0f9a9fb0a573379259f2a77458d50192"
|
||||
|
||||
Reference in New Issue
Block a user