Merge from vscode cfc1ab4c5f816765b91fb7ead3c3427a7c8581a3

This commit is contained in:
ADS Merger
2020-03-11 04:19:23 +00:00
parent 16fab722d5
commit 4c3e48773d
880 changed files with 20441 additions and 11232 deletions
-1
View File
@@ -3,7 +3,6 @@
**/vs/css.build.js **/vs/css.build.js
**/vs/css.js **/vs/css.js
**/vs/loader.js **/vs/loader.js
**/promise-polyfill/**
**/insane/** **/insane/**
**/marked/** **/marked/**
**/test/**/*.js **/test/**/*.js
+2 -1
View File
@@ -35,7 +35,8 @@
"external", "external",
"status", "status",
"origin", "origin",
"orientation" "orientation",
"context"
], // non-complete list of globals that are easy to access unintentionally ], // non-complete list of globals that are easy to access unintentionally
"no-var": "warn", "no-var": "warn",
"jsdoc/no-types": "warn", "jsdoc/no-types": "warn",
+1
View File
@@ -92,6 +92,7 @@
], ],
"webRoot": "${workspaceFolder}", "webRoot": "${workspaceFolder}",
// Settings for js-debug: // Settings for js-debug:
"userDataDir": false,
"pauseForSourceMap": false, "pauseForSourceMap": false,
"outFiles": [ "outFiles": [
"${workspaceFolder}/out/**/*.js" "${workspaceFolder}/out/**/*.js"
+74
View File
@@ -0,0 +1,74 @@
# Query: @deprecated ES6
# Flags: CaseSensitive WordMatch
# ContextLines: 2
11 results - 3 files
src/vs/base/common/arrays.ts:
401
402 /**
403: * @deprecated ES6: use `Array.findIndex`
404 */
405 export function firstIndex<T>(array: ReadonlyArray<T>, fn: (item: T) => boolean): number {
417
418 /**
419: * @deprecated ES6: use `Array.find`
420 */
421 export function first<T>(array: ReadonlyArray<T>, fn: (item: T) => boolean, notFoundValue: T): T;
474
475 /**
476: * @deprecated ES6: use `Array.fill`
477 */
478 export function fill<T>(num: number, value: T, arr: T[] = []): T[] {
571
572 /**
573: * @deprecated ES6: use `Array.find`
574 */
575 export function find<T>(arr: ArrayLike<T>, predicate: (value: T, index: number, arr: ArrayLike<T>) => any): T | undefined {
src/vs/base/common/map.ts:
9
10 /**
11: * @deprecated ES6: use `[...SetOrMap.values()]`
12 */
13 export function values<V = any>(set: Set<V>): V[];
20
21 /**
22: * @deprecated ES6: use `[...map.keys()]`
23 */
24 export function keys<K, V>(map: Map<K, V>): K[] {
58
59 /**
60: * @deprecated ES6: use `...Map.entries()`
61 */
62 export function mapToSerializable(map: Map<string, string>): [string, string][] {
71
72 /**
73: * @deprecated ES6: use `new Map([[key1, value1],[key2, value2]])`
74 */
75 export function serializableToMap(serializable: [string, string][]): Map<string, string> {
src/vs/base/common/strings.ts:
16
17 /**
18: * @deprecated ES6: use `String.padStart`
19 */
20 export function pad(n: number, l: number, char: string = '0'): string {
147
148 /**
149: * @deprecated ES6: use `String.startsWith`
150 */
151 export function startsWith(haystack: string, needle: string): boolean {
168
169 /**
170: * @deprecated ES6: use `String.endsWith`
171 */
172 export function endsWith(haystack: string, needle: string): boolean {
+4 -1
View File
@@ -69,5 +69,8 @@
"msjsdiag.debugger-for-chrome": "workspace" "msjsdiag.debugger-for-chrome": "workspace"
}, },
"gulp.autoDetect": "off", "gulp.autoDetect": "off",
"files.insertFinalNewline": true "files.insertFinalNewline": true,
"[typescript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
}
} }
+3 -3
View File
@@ -16758,7 +16758,7 @@ exports.Deprecation = Deprecation;
* isobject <https://github.com/jonschlinkert/isobject> * isobject <https://github.com/jonschlinkert/isobject>
* *
* Copyright (c) 2014-2017, Jon Schlinkert. * Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License. * Released under the Source EULA.
*/ */
function isObject(val) { function isObject(val) {
@@ -16769,7 +16769,7 @@ function isObject(val) {
* is-plain-object <https://github.com/jonschlinkert/is-plain-object> * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
* *
* Copyright (c) 2014-2017, Jon Schlinkert. * Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License. * Released under the Source EULA.
*/ */
function isObjectObject(o) { function isObjectObject(o) {
@@ -31507,7 +31507,7 @@ exports.restEndpointMethods = restEndpointMethods;
* write <https://github.com/jonschlinkert/write> * write <https://github.com/jonschlinkert/write>
* *
* Copyright (c) 2014-2017, Jon Schlinkert. * Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License. * Released under the Source EULA.
*/ */
+3 -3
View File
@@ -16813,7 +16813,7 @@ exports.Deprecation = Deprecation;
* isobject <https://github.com/jonschlinkert/isobject> * isobject <https://github.com/jonschlinkert/isobject>
* *
* Copyright (c) 2014-2017, Jon Schlinkert. * Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License. * Released under the Source EULA.
*/ */
function isObject(val) { function isObject(val) {
@@ -16824,7 +16824,7 @@ function isObject(val) {
* is-plain-object <https://github.com/jonschlinkert/is-plain-object> * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
* *
* Copyright (c) 2014-2017, Jon Schlinkert. * Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License. * Released under the Source EULA.
*/ */
function isObjectObject(o) { function isObjectObject(o) {
@@ -31562,7 +31562,7 @@ exports.restEndpointMethods = restEndpointMethods;
* write <https://github.com/jonschlinkert/write> * write <https://github.com/jonschlinkert/write>
* *
* Copyright (c) 2014-2017, Jon Schlinkert. * Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License. * Released under the Source EULA.
*/ */
@@ -135,6 +135,23 @@ steps:
displayName: Run integration tests (Browser) displayName: Run integration tests (Browser)
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false')) condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
- script: |
set -e
APP_ROOT=$(agent.builddirectory)/VSCode-darwin
APP_NAME="`ls $APP_ROOT | head -n 1`"
yarn smoketest --build "$APP_ROOT/$APP_NAME"
continueOnError: true
displayName: Run smoke tests (Electron)
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
- script: |
set -e
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-web-darwin" \
yarn smoketest --web --headless
continueOnError: true
displayName: Run smoke tests (Browser)
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
- script: | - script: |
set -e set -e
security create-keychain -p pwd $(agent.tempdirectory)/buildagent.keychain security create-keychain -p pwd $(agent.tempdirectory)/buildagent.keychain
+41 -34
View File
@@ -72,13 +72,8 @@ const extractEditorSrcTask = task.define('extract-editor-src', () => {
apiusages, apiusages,
extrausages extrausages
], ],
libs: [
`lib.es5.d.ts`,
`lib.dom.d.ts`,
`lib.webworker.importscripts.d.ts`
],
shakeLevel: 2, // 0-Files, 1-InnerFile, 2-ClassMembers shakeLevel: 2, // 0-Files, 1-InnerFile, 2-ClassMembers
importIgnorePattern: /(^vs\/css!)|(promise-polyfill\/polyfill)/, importIgnorePattern: /(^vs\/css!)/,
destRoot: path.join(root, 'out-editor-src'), destRoot: path.join(root, 'out-editor-src'),
redirects: [] redirects: []
}); });
@@ -131,6 +126,7 @@ const createESMSourcesAndResourcesTask = task.define('extract-editor-esm', () =>
}); });
const compileEditorESMTask = task.define('compile-editor-esm', () => { const compileEditorESMTask = task.define('compile-editor-esm', () => {
const KEEP_PREV_ANALYSIS = false;
console.log(`Launching the TS compiler at ${path.join(__dirname, '../out-editor-esm')}...`); console.log(`Launching the TS compiler at ${path.join(__dirname, '../out-editor-esm')}...`);
let result; let result;
if (process.platform === 'win32') { if (process.platform === 'win32') {
@@ -149,41 +145,45 @@ const compileEditorESMTask = task.define('compile-editor-esm', () => {
if (result.status !== 0) { if (result.status !== 0) {
console.log(`The TS Compilation failed, preparing analysis folder...`); console.log(`The TS Compilation failed, preparing analysis folder...`);
const destPath = path.join(__dirname, '../../vscode-monaco-editor-esm-analysis'); const destPath = path.join(__dirname, '../../vscode-monaco-editor-esm-analysis');
return util.rimraf(destPath)().then(() => { const keepPrevAnalysis = (KEEP_PREV_ANALYSIS && fs.existsSync(destPath));
fs.mkdirSync(destPath); const cleanDestPath = (keepPrevAnalysis ? Promise.resolve() : util.rimraf(destPath)());
return cleanDestPath.then(() => {
// initialize a new repository
cp.spawnSync(`git`, [`init`], {
cwd: destPath
});
// build a list of files to copy // build a list of files to copy
const files = util.rreddir(path.join(__dirname, '../out-editor-esm')); const files = util.rreddir(path.join(__dirname, '../out-editor-esm'));
// copy files from src if (!keepPrevAnalysis) {
for (const file of files) { fs.mkdirSync(destPath);
const srcFilePath = path.join(__dirname, '../src', file);
const dstFilePath = path.join(destPath, file); // initialize a new repository
if (fs.existsSync(srcFilePath)) { cp.spawnSync(`git`, [`init`], {
util.ensureDir(path.dirname(dstFilePath)); cwd: destPath
const contents = fs.readFileSync(srcFilePath).toString().replace(/\r\n|\r|\n/g, '\n'); });
fs.writeFileSync(dstFilePath, contents);
// copy files from src
for (const file of files) {
const srcFilePath = path.join(__dirname, '../src', file);
const dstFilePath = path.join(destPath, file);
if (fs.existsSync(srcFilePath)) {
util.ensureDir(path.dirname(dstFilePath));
const contents = fs.readFileSync(srcFilePath).toString().replace(/\r\n|\r|\n/g, '\n');
fs.writeFileSync(dstFilePath, contents);
}
} }
// create an initial commit to diff against
cp.spawnSync(`git`, [`add`, `.`], {
cwd: destPath
});
// create the commit
cp.spawnSync(`git`, [`commit`, `-m`, `"original sources"`, `--no-gpg-sign`], {
cwd: destPath
});
} }
// create an initial commit to diff against // copy files from tree shaken src
cp.spawnSync(`git`, [`add`, `.`], {
cwd: destPath
});
// create the commit
cp.spawnSync(`git`, [`commit`, `-m`, `"original sources"`, `--no-gpg-sign`], {
cwd: destPath
});
// copy files from esm
for (const file of files) { for (const file of files) {
const srcFilePath = path.join(__dirname, '../out-editor-esm', file); const srcFilePath = path.join(__dirname, '../out-editor-src', file);
const dstFilePath = path.join(destPath, file); const dstFilePath = path.join(destPath, file);
if (fs.existsSync(srcFilePath)) { if (fs.existsSync(srcFilePath)) {
util.ensureDir(path.dirname(dstFilePath)); util.ensureDir(path.dirname(dstFilePath));
@@ -334,6 +334,13 @@ const finalEditorResourcesTask = task.define('final-editor-resources', () => {
); );
}); });
gulp.task('extract-editor-src',
task.series(
util.rimraf('out-editor-src'),
extractEditorSrcTask
)
);
gulp.task('editor-distro', gulp.task('editor-distro',
task.series( task.series(
task.parallel( task.parallel(
-1
View File
@@ -128,7 +128,6 @@ const copyrightFilter = [
'!**/*.disabled', '!**/*.disabled',
'!**/*.code-workspace', '!**/*.code-workspace',
'!**/*.js.map', '!**/*.js.map',
'!**/promise-polyfill/polyfill.js',
'!build/**/*.init', '!build/**/*.init',
'!resources/linux/snap/snapcraft.yaml', '!resources/linux/snap/snapcraft.yaml',
'!resources/linux/snap/electron-launch', '!resources/linux/snap/electron-launch',
+1
View File
@@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
'use strict'; 'use strict';
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.createAsar = void 0;
const path = require("path"); const path = require("path");
const es = require("event-stream"); const es = require("event-stream");
const pickle = require('chromium-pickle-js'); const pickle = require('chromium-pickle-js');
+1
View File
@@ -4,6 +4,7 @@
* Licensed under the Source EULA. See License.txt in the project root for license information. * Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.bundle = void 0;
const fs = require("fs"); const fs = require("fs");
const path = require("path"); const path = require("path");
const vm = require("vm"); const vm = require("vm");
+1
View File
@@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
'use strict'; 'use strict';
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.watchTask = exports.compileTask = void 0;
const es = require("event-stream"); const es = require("event-stream");
const fs = require("fs"); const fs = require("fs");
const gulp = require("gulp"); const gulp = require("gulp");
+1
View File
@@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
'use strict'; 'use strict';
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.config = exports.getElectronVersion = void 0;
const fs = require("fs"); const fs = require("fs");
const path = require("path"); const path = require("path");
const vfs = require("vinyl-fs"); const vfs = require("vinyl-fs");
+1
View File
@@ -4,6 +4,7 @@
* Licensed under the Source EULA. See License.txt in the project root for license information. * Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.createImportRuleListener = void 0;
function createImportRuleListener(validateImport) { function createImportRuleListener(validateImport) {
function _checkImport(node) { function _checkImport(node) {
if (node && node.type === 'Literal' && typeof node.value === 'string') { if (node && node.type === 'Literal' && typeof node.value === 'string') {
+1
View File
@@ -4,6 +4,7 @@
* Licensed under the Source EULA. See License.txt in the project root for license information. * Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.packageRebuildExtensionsStream = exports.cleanRebuildExtensions = exports.packageExternalExtensionsStream = exports.packageMarketplaceExtensionsStream = exports.packageLocalExtensionsStream = exports.fromMarketplace = void 0;
const es = require("event-stream"); const es = require("event-stream");
const fs = require("fs"); const fs = require("fs");
const glob = require("glob"); const glob = require("glob");
+1
View File
@@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
'use strict'; 'use strict';
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.getVersion = void 0;
const path = require("path"); const path = require("path");
const fs = require("fs"); const fs = require("fs");
/** /**
+149 -142
View File
@@ -4,6 +4,7 @@
* Licensed under the Source EULA. See License.txt in the project root for license information. * Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.prepareIslFiles = exports.prepareI18nPackFiles = exports.pullI18nPackFiles = exports.prepareI18nFiles = exports.pullSetupXlfFiles = exports.pullCoreAndExtensionsXlfFiles = exports.findObsoleteResources = exports.pushXlfFiles = exports.createXlfFilesForIsl = exports.createXlfFilesForExtensions = exports.createXlfFilesForCoreBundle = exports.getResource = exports.processNlsFiles = exports.Limiter = exports.XLF = exports.Line = exports.externalExtensionsWithTranslations = exports.extraLanguages = exports.defaultLanguages = void 0;
const path = require("path"); const path = require("path");
const fs = require("fs"); const fs = require("fs");
const event_stream_1 = require("event-stream"); const event_stream_1 = require("event-stream");
@@ -100,155 +101,161 @@ class TextModel {
return this._lines; return this._lines;
} }
} }
class XLF { let XLF = /** @class */ (() => {
constructor(project) { class XLF {
this.project = project; constructor(project) {
this.buffer = []; this.project = project;
this.files = Object.create(null); this.buffer = [];
this.numberOfMessages = 0; this.files = Object.create(null);
} this.numberOfMessages = 0;
toString() {
this.appendHeader();
for (let file in this.files) {
this.appendNewLine(`<file original="${file}" source-language="en" datatype="plaintext"><body>`, 2);
for (let item of this.files[file]) {
this.addStringItem(item);
}
this.appendNewLine('</body></file>', 2);
} }
this.appendFooter(); toString() {
return this.buffer.join('\r\n'); this.appendHeader();
} for (let file in this.files) {
addFile(original, keys, messages) { this.appendNewLine(`<file original="${file}" source-language="en" datatype="plaintext"><body>`, 2);
if (keys.length === 0) { for (let item of this.files[file]) {
console.log('No keys in ' + original); this.addStringItem(file, item);
return;
}
if (keys.length !== messages.length) {
throw new Error(`Unmatching keys(${keys.length}) and messages(${messages.length}).`);
}
this.numberOfMessages += keys.length;
this.files[original] = [];
let existingKeys = new Set();
for (let i = 0; i < keys.length; i++) {
let key = keys[i];
let realKey;
let comment;
if (Is.string(key)) {
realKey = key;
comment = undefined;
}
else if (LocalizeInfo.is(key)) {
realKey = key.key;
if (key.comment && key.comment.length > 0) {
comment = key.comment.map(comment => encodeEntities(comment)).join('\r\n');
} }
this.appendNewLine('</body></file>', 2);
} }
if (!realKey || existingKeys.has(realKey)) { this.appendFooter();
continue; return this.buffer.join('\r\n');
}
addFile(original, keys, messages) {
if (keys.length === 0) {
console.log('No keys in ' + original);
return;
} }
existingKeys.add(realKey); if (keys.length !== messages.length) {
let message = encodeEntities(messages[i]); throw new Error(`Unmatching keys(${keys.length}) and messages(${messages.length}).`);
this.files[original].push({ id: realKey, message: message, comment: comment }); }
this.numberOfMessages += keys.length;
this.files[original] = [];
let existingKeys = new Set();
for (let i = 0; i < keys.length; i++) {
let key = keys[i];
let realKey;
let comment;
if (Is.string(key)) {
realKey = key;
comment = undefined;
}
else if (LocalizeInfo.is(key)) {
realKey = key.key;
if (key.comment && key.comment.length > 0) {
comment = key.comment.map(comment => encodeEntities(comment)).join('\r\n');
}
}
if (!realKey || existingKeys.has(realKey)) {
continue;
}
existingKeys.add(realKey);
let message = encodeEntities(messages[i]);
this.files[original].push({ id: realKey, message: message, comment: comment });
}
}
addStringItem(file, item) {
if (!item.id || item.message === undefined || item.message === null) {
throw new Error(`No item ID or value specified: ${JSON.stringify(item)}. File: ${file}`);
}
if (item.message.length === 0) {
log(`Item with id ${item.id} in file ${file} has an empty message.`);
}
this.appendNewLine(`<trans-unit id="${item.id}">`, 4);
this.appendNewLine(`<source xml:lang="en">${item.message}</source>`, 6);
if (item.comment) {
this.appendNewLine(`<note>${item.comment}</note>`, 6);
}
this.appendNewLine('</trans-unit>', 4);
}
appendHeader() {
this.appendNewLine('<?xml version="1.0" encoding="utf-8"?>', 0);
this.appendNewLine('<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">', 0);
}
appendFooter() {
this.appendNewLine('</xliff>', 0);
}
appendNewLine(content, indent) {
let line = new Line(indent);
line.append(content);
this.buffer.push(line.toString());
} }
} }
addStringItem(item) { XLF.parsePseudo = function (xlfString) {
if (!item.id || !item.message) { return new Promise((resolve) => {
throw new Error(`No item ID or value specified: ${JSON.stringify(item)}`); let parser = new xml2js.Parser();
} let files = [];
this.appendNewLine(`<trans-unit id="${item.id}">`, 4); parser.parseString(xlfString, function (_err, result) {
this.appendNewLine(`<source xml:lang="en">${item.message}</source>`, 6); const fileNodes = result['xliff']['file'];
if (item.comment) { fileNodes.forEach(file => {
this.appendNewLine(`<note>${item.comment}</note>`, 6); const originalFilePath = file.$.original;
} const messages = {};
this.appendNewLine('</trans-unit>', 4); const transUnits = file.body[0]['trans-unit'];
} if (transUnits) {
appendHeader() { transUnits.forEach((unit) => {
this.appendNewLine('<?xml version="1.0" encoding="utf-8"?>', 0); const key = unit.$.id;
this.appendNewLine('<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">', 0); const val = pseudify(unit.source[0]['_'].toString());
} if (key && val) {
appendFooter() { messages[key] = decodeEntities(val);
this.appendNewLine('</xliff>', 0); }
} });
appendNewLine(content, indent) { files.push({ messages: messages, originalFilePath: originalFilePath, language: 'ps' });
let line = new Line(indent); }
line.append(content); });
this.buffer.push(line.toString()); resolve(files);
} });
} });
};
XLF.parse = function (xlfString) {
return new Promise((resolve, reject) => {
let parser = new xml2js.Parser();
let files = [];
parser.parseString(xlfString, function (err, result) {
if (err) {
reject(new Error(`XLF parsing error: Failed to parse XLIFF string. ${err}`));
}
const fileNodes = result['xliff']['file'];
if (!fileNodes) {
reject(new Error(`XLF parsing error: XLIFF file does not contain "xliff" or "file" node(s) required for parsing.`));
}
fileNodes.forEach((file) => {
const originalFilePath = file.$.original;
if (!originalFilePath) {
reject(new Error(`XLF parsing error: XLIFF file node does not contain original attribute to determine the original location of the resource file.`));
}
let language = file.$['target-language'];
if (!language) {
reject(new Error(`XLF parsing error: XLIFF file node does not contain target-language attribute to determine translated language.`));
}
const messages = {};
const transUnits = file.body[0]['trans-unit'];
if (transUnits) {
transUnits.forEach((unit) => {
const key = unit.$.id;
if (!unit.target) {
return; // No translation available
}
let val = unit.target[0];
if (typeof val !== 'string') {
val = val._;
}
if (key && val) {
messages[key] = decodeEntities(val);
}
else {
reject(new Error(`XLF parsing error: XLIFF file ${originalFilePath} does not contain full localization data. ID or target translation for one of the trans-unit nodes is not present.`));
}
});
files.push({ messages: messages, originalFilePath: originalFilePath, language: language.toLowerCase() });
}
});
resolve(files);
});
});
};
return XLF;
})();
exports.XLF = XLF; exports.XLF = XLF;
XLF.parsePseudo = function (xlfString) {
return new Promise((resolve) => {
let parser = new xml2js.Parser();
let files = [];
parser.parseString(xlfString, function (_err, result) {
const fileNodes = result['xliff']['file'];
fileNodes.forEach(file => {
const originalFilePath = file.$.original;
const messages = {};
const transUnits = file.body[0]['trans-unit'];
if (transUnits) {
transUnits.forEach((unit) => {
const key = unit.$.id;
const val = pseudify(unit.source[0]['_'].toString());
if (key && val) {
messages[key] = decodeEntities(val);
}
});
files.push({ messages: messages, originalFilePath: originalFilePath, language: 'ps' });
}
});
resolve(files);
});
});
};
XLF.parse = function (xlfString) {
return new Promise((resolve, reject) => {
let parser = new xml2js.Parser();
let files = [];
parser.parseString(xlfString, function (err, result) {
if (err) {
reject(new Error(`XLF parsing error: Failed to parse XLIFF string. ${err}`));
}
const fileNodes = result['xliff']['file'];
if (!fileNodes) {
reject(new Error(`XLF parsing error: XLIFF file does not contain "xliff" or "file" node(s) required for parsing.`));
}
fileNodes.forEach((file) => {
const originalFilePath = file.$.original;
if (!originalFilePath) {
reject(new Error(`XLF parsing error: XLIFF file node does not contain original attribute to determine the original location of the resource file.`));
}
let language = file.$['target-language'];
if (!language) {
reject(new Error(`XLF parsing error: XLIFF file node does not contain target-language attribute to determine translated language.`));
}
const messages = {};
const transUnits = file.body[0]['trans-unit'];
if (transUnits) {
transUnits.forEach((unit) => {
const key = unit.$.id;
if (!unit.target) {
return; // No translation available
}
let val = unit.target[0];
if (typeof val !== 'string') {
val = val._;
}
if (key && val) {
messages[key] = decodeEntities(val);
}
else {
reject(new Error(`XLF parsing error: XLIFF file ${originalFilePath} does not contain full localization data. ID or target translation for one of the trans-unit nodes is not present.`));
}
});
files.push({ messages: messages, originalFilePath: originalFilePath, language: language.toLowerCase() });
}
});
resolve(files);
});
});
};
class Limiter { class Limiter {
constructor(maxDegreeOfParalellism) { constructor(maxDegreeOfParalellism) {
this.maxDegreeOfParalellism = maxDegreeOfParalellism; this.maxDegreeOfParalellism = maxDegreeOfParalellism;
+8
View File
@@ -122,6 +122,10 @@
"name": "vs/workbench/contrib/preferences", "name": "vs/workbench/contrib/preferences",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{
"name": "vs/workbench/contrib/quickaccess",
"project": "vscode-workbench"
},
{ {
"name": "vs/workbench/contrib/quickopen", "name": "vs/workbench/contrib/quickopen",
"project": "vscode-workbench" "project": "vscode-workbench"
@@ -262,6 +266,10 @@
"name": "vs/workbench/services/files", "name": "vs/workbench/services/files",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{
"name": "vs/workbench/services/log",
"project": "vscode-workbench"
},
{ {
"name": "vs/workbench/services/integrity", "name": "vs/workbench/services/integrity",
"project": "vscode-workbench" "project": "vscode-workbench"
+7 -4
View File
@@ -201,7 +201,7 @@ export class XLF {
for (let file in this.files) { for (let file in this.files) {
this.appendNewLine(`<file original="${file}" source-language="en" datatype="plaintext"><body>`, 2); this.appendNewLine(`<file original="${file}" source-language="en" datatype="plaintext"><body>`, 2);
for (let item of this.files[file]) { for (let item of this.files[file]) {
this.addStringItem(item); this.addStringItem(file, item);
} }
this.appendNewLine('</body></file>', 2); this.appendNewLine('</body></file>', 2);
} }
@@ -243,9 +243,12 @@ export class XLF {
} }
} }
private addStringItem(item: Item): void { private addStringItem(file: string, item: Item): void {
if (!item.id || !item.message) { if (!item.id || item.message === undefined || item.message === null) {
throw new Error(`No item ID or value specified: ${JSON.stringify(item)}`); throw new Error(`No item ID or value specified: ${JSON.stringify(item)}. File: ${file}`);
}
if (item.message.length === 0) {
log(`Item with id ${item.id} in file ${file} has an empty message.`);
} }
this.appendNewLine(`<trans-unit id="${item.id}">`, 4); this.appendNewLine(`<trans-unit id="${item.id}">`, 4);
+1
View File
@@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
'use strict'; 'use strict';
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.minifyTask = exports.optimizeTask = exports.loaderConfig = void 0;
const es = require("event-stream"); const es = require("event-stream");
const fs = require("fs"); const fs = require("fs");
const gulp = require("gulp"); const gulp = require("gulp");
+1
View File
@@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
'use strict'; 'use strict';
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.createReporter = void 0;
const es = require("event-stream"); const es = require("event-stream");
const _ = require("underscore"); const _ = require("underscore");
const fancyLog = require("fancy-log"); const fancyLog = require("fancy-log");
+1
View File
@@ -4,6 +4,7 @@
* Licensed under the Source EULA. See License.txt in the project root for license information. * Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.rollupAngular = exports.rollupAngularSlickgrid = void 0;
const fs = require("fs"); const fs = require("fs");
const rollup = require("rollup"); const rollup = require("rollup");
const path = require("path"); const path = require("path");
+1
View File
@@ -4,6 +4,7 @@
* Licensed under the Source EULA. See License.txt in the project root for license information. * Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.createESMSourcesAndResources2 = exports.extractEditor = void 0;
const ts = require("typescript"); const ts = require("typescript");
const fs = require("fs"); const fs = require("fs");
const path = require("path"); const path = require("path");
+1
View File
@@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
'use strict'; 'use strict';
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.submitAllStats = exports.createStatsStream = void 0;
const es = require("event-stream"); const es = require("event-stream");
const fancyLog = require("fancy-log"); const fancyLog = require("fancy-log");
const ansiColors = require("ansi-colors"); const ansiColors = require("ansi-colors");
+1
View File
@@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
'use strict'; 'use strict';
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.define = exports.parallel = exports.series = void 0;
const fancyLog = require("fancy-log"); const fancyLog = require("fancy-log");
const ansiColors = require("ansi-colors"); const ansiColors = require("ansi-colors");
function _isPromise(p) { function _isPromise(p) {
+69 -8
View File
@@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
'use strict'; 'use strict';
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.shake = exports.toStringShakeLevel = exports.ShakeLevel = void 0;
const fs = require("fs"); const fs = require("fs");
const path = require("path"); const path = require("path");
const ts = require("typescript"); const ts = require("typescript");
@@ -75,11 +76,7 @@ function createTypeScriptLanguageService(options) {
FILES[typing] = fs.readFileSync(filePath).toString(); FILES[typing] = fs.readFileSync(filePath).toString();
}); });
// Resolve libs // Resolve libs
const RESOLVED_LIBS = {}; const RESOLVED_LIBS = processLibFiles(options);
options.libs.forEach((filename) => {
const filepath = path.join(TYPESCRIPT_LIB_FOLDER, filename);
RESOLVED_LIBS[`defaultLib:${filename}`] = fs.readFileSync(filepath).toString();
});
const compilerOptions = ts.convertCompilerOptionsFromJson(options.compilerOptions, options.sourcesRoot).options; const compilerOptions = ts.convertCompilerOptionsFromJson(options.compilerOptions, options.sourcesRoot).options;
const host = new TypeScriptLanguageServiceHost(RESOLVED_LIBS, FILES, compilerOptions); const host = new TypeScriptLanguageServiceHost(RESOLVED_LIBS, FILES, compilerOptions);
return ts.createLanguageService(host); return ts.createLanguageService(host);
@@ -137,6 +134,29 @@ function discoverAndReadFiles(options) {
} }
return FILES; return FILES;
} }
/**
* Read lib files and follow lib references
*/
function processLibFiles(options) {
const stack = [...options.compilerOptions.lib];
const result = {};
while (stack.length > 0) {
const filename = `lib.${stack.shift().toLowerCase()}.d.ts`;
const key = `defaultLib:${filename}`;
if (!result[key]) {
// add this file
const filepath = path.join(TYPESCRIPT_LIB_FOLDER, filename);
const sourceText = fs.readFileSync(filepath).toString();
result[key] = sourceText;
// precess dependencies and "recurse"
const info = ts.preProcessFile(sourceText);
for (let ref of info.libReferenceDirectives) {
stack.push(ref.fileName);
}
}
}
return result;
}
/** /**
* A TypeScript language service host * A TypeScript language service host
*/ */
@@ -234,6 +254,7 @@ function markNodes(languageService, options) {
} }
const black_queue = []; const black_queue = [];
const gray_queue = []; const gray_queue = [];
const export_import_queue = [];
const sourceFilesLoaded = {}; const sourceFilesLoaded = {};
function enqueueTopLevelModuleStatements(sourceFile) { function enqueueTopLevelModuleStatements(sourceFile) {
sourceFile.forEachChild((node) => { sourceFile.forEachChild((node) => {
@@ -245,10 +266,16 @@ function markNodes(languageService, options) {
return; return;
} }
if (ts.isExportDeclaration(node)) { if (ts.isExportDeclaration(node)) {
if (node.moduleSpecifier && ts.isStringLiteral(node.moduleSpecifier)) { if (!node.exportClause && node.moduleSpecifier && ts.isStringLiteral(node.moduleSpecifier)) {
// export * from "foo";
setColor(node, 2 /* Black */); setColor(node, 2 /* Black */);
enqueueImport(node, node.moduleSpecifier.text); enqueueImport(node, node.moduleSpecifier.text);
} }
if (node.exportClause && ts.isNamedExports(node.exportClause)) {
for (const exportSpecifier of node.exportClause.elements) {
export_import_queue.push(exportSpecifier);
}
}
return; return;
} }
if (ts.isExpressionStatement(node) if (ts.isExpressionStatement(node)
@@ -402,6 +429,7 @@ function markNodes(languageService, options) {
|| ts.isConstructSignatureDeclaration(member) || ts.isConstructSignatureDeclaration(member)
|| ts.isIndexSignatureDeclaration(member) || ts.isIndexSignatureDeclaration(member)
|| ts.isCallSignatureDeclaration(member) || ts.isCallSignatureDeclaration(member)
|| memberName === '[Symbol.iterator]'
|| memberName === 'toJSON' || memberName === 'toJSON'
|| memberName === 'toString' || memberName === 'toString'
|| memberName === 'dispose' // TODO: keeping all `dispose` methods || memberName === 'dispose' // TODO: keeping all `dispose` methods
@@ -426,6 +454,22 @@ function markNodes(languageService, options) {
}; };
node.forEachChild(loop); node.forEachChild(loop);
} }
while (export_import_queue.length > 0) {
const node = export_import_queue.shift();
if (nodeOrParentIsBlack(node)) {
continue;
}
const symbol = node.symbol;
if (!symbol) {
continue;
}
const aliased = checker.getAliasedSymbol(symbol);
if (aliased.declarations && aliased.declarations.length > 0) {
if (nodeOrParentIsBlack(aliased.declarations[0]) || nodeOrChildIsBlack(aliased.declarations[0])) {
setColor(node, 2 /* Black */);
}
}
}
} }
function nodeIsInItsOwnDeclaration(nodeSourceFile, node, symbol) { function nodeIsInItsOwnDeclaration(nodeSourceFile, node, symbol) {
for (let i = 0, len = symbol.declarations.length; i < len; i++) { for (let i = 0, len = symbol.declarations.length; i < len; i++) {
@@ -517,6 +561,21 @@ function generateResult(languageService, shakeLevel) {
} }
} }
} }
if (ts.isExportDeclaration(node)) {
if (node.exportClause && node.moduleSpecifier && ts.isNamedExports(node.exportClause)) {
let survivingExports = [];
for (const exportSpecifier of node.exportClause.elements) {
if (getColor(exportSpecifier) === 2 /* Black */) {
survivingExports.push(exportSpecifier.getFullText(sourceFile));
}
}
const leadingTriviaWidth = node.getLeadingTriviaWidth();
const leadingTrivia = sourceFile.text.substr(node.pos, leadingTriviaWidth);
if (survivingExports.length > 0) {
return write(`${leadingTrivia}export {${survivingExports.join(',')} } from${node.moduleSpecifier.getFullText(sourceFile)};`);
}
}
}
if (shakeLevel === 2 /* ClassMembers */ && (ts.isClassDeclaration(node) || ts.isInterfaceDeclaration(node)) && nodeOrChildIsBlack(node)) { if (shakeLevel === 2 /* ClassMembers */ && (ts.isClassDeclaration(node) || ts.isInterfaceDeclaration(node)) && nodeOrChildIsBlack(node)) {
let toWrite = node.getFullText(); let toWrite = node.getFullText();
for (let i = node.members.length - 1; i >= 0; i--) { for (let i = node.members.length - 1; i >= 0; i--) {
@@ -567,7 +626,7 @@ function getRealNodeSymbol(checker, node) {
// (2) when the aliased symbol is originating from an import. // (2) when the aliased symbol is originating from an import.
// //
function shouldSkipAlias(node, declaration) { function shouldSkipAlias(node, declaration) {
if (node.kind !== ts.SyntaxKind.Identifier) { if (!ts.isShorthandPropertyAssignment(node) && node.kind !== ts.SyntaxKind.Identifier) {
return false; return false;
} }
if (node.parent === declaration) { if (node.parent === declaration) {
@@ -589,7 +648,9 @@ function getRealNodeSymbol(checker, node) {
} }
} }
const { parent } = node; const { parent } = node;
let symbol = checker.getSymbolAtLocation(node); let symbol = (ts.isShorthandPropertyAssignment(node)
? checker.getShorthandAssignmentValueSymbol(node)
: checker.getSymbolAtLocation(node));
let importNode = null; let importNode = null;
// If this is an alias, and the request came at the declaration location // If this is an alias, and the request came at the declaration location
// get the aliased symbol instead. This allows for goto def on an import e.g. // get the aliased symbol instead. This allows for goto def on an import e.g.
+80 -15
View File
@@ -18,7 +18,7 @@ export const enum ShakeLevel {
} }
export function toStringShakeLevel(shakeLevel: ShakeLevel): string { export function toStringShakeLevel(shakeLevel: ShakeLevel): string {
switch(shakeLevel) { switch (shakeLevel) {
case ShakeLevel.Files: case ShakeLevel.Files:
return 'Files (0)'; return 'Files (0)';
case ShakeLevel.InnerFile: case ShakeLevel.InnerFile:
@@ -42,11 +42,6 @@ export interface ITreeShakingOptions {
* Inline usages. * Inline usages.
*/ */
inlineEntryPoints: string[]; inlineEntryPoints: string[];
/**
* TypeScript libs.
* e.g. `lib.d.ts`, `lib.es2015.collection.d.ts`
*/
libs: string[];
/** /**
* Other .d.ts files * Other .d.ts files
*/ */
@@ -130,11 +125,7 @@ function createTypeScriptLanguageService(options: ITreeShakingOptions): ts.Langu
}); });
// Resolve libs // Resolve libs
const RESOLVED_LIBS: ILibMap = {}; const RESOLVED_LIBS = processLibFiles(options);
options.libs.forEach((filename) => {
const filepath = path.join(TYPESCRIPT_LIB_FOLDER, filename);
RESOLVED_LIBS[`defaultLib:${filename}`] = fs.readFileSync(filepath).toString();
});
const compilerOptions = ts.convertCompilerOptionsFromJson(options.compilerOptions, options.sourcesRoot).options; const compilerOptions = ts.convertCompilerOptionsFromJson(options.compilerOptions, options.sourcesRoot).options;
@@ -205,6 +196,34 @@ function discoverAndReadFiles(options: ITreeShakingOptions): IFileMap {
return FILES; return FILES;
} }
/**
* Read lib files and follow lib references
*/
function processLibFiles(options: ITreeShakingOptions): ILibMap {
const stack: string[] = [...options.compilerOptions.lib];
const result: ILibMap = {};
while (stack.length > 0) {
const filename = `lib.${stack.shift()!.toLowerCase()}.d.ts`;
const key = `defaultLib:${filename}`;
if (!result[key]) {
// add this file
const filepath = path.join(TYPESCRIPT_LIB_FOLDER, filename);
const sourceText = fs.readFileSync(filepath).toString();
result[key] = sourceText;
// precess dependencies and "recurse"
const info = ts.preProcessFile(sourceText);
for (let ref of info.libReferenceDirectives) {
stack.push(ref.fileName);
}
}
}
return result;
}
interface ILibMap { [libName: string]: string; } interface ILibMap { [libName: string]: string; }
interface IFileMap { [fileName: string]: string; } interface IFileMap { [fileName: string]: string; }
@@ -317,6 +336,7 @@ function markNodes(languageService: ts.LanguageService, options: ITreeShakingOpt
const black_queue: ts.Node[] = []; const black_queue: ts.Node[] = [];
const gray_queue: ts.Node[] = []; const gray_queue: ts.Node[] = [];
const export_import_queue: ts.Node[] = [];
const sourceFilesLoaded: { [fileName: string]: boolean } = {}; const sourceFilesLoaded: { [fileName: string]: boolean } = {};
function enqueueTopLevelModuleStatements(sourceFile: ts.SourceFile): void { function enqueueTopLevelModuleStatements(sourceFile: ts.SourceFile): void {
@@ -332,10 +352,16 @@ function markNodes(languageService: ts.LanguageService, options: ITreeShakingOpt
} }
if (ts.isExportDeclaration(node)) { if (ts.isExportDeclaration(node)) {
if (node.moduleSpecifier && ts.isStringLiteral(node.moduleSpecifier)) { if (!node.exportClause && node.moduleSpecifier && ts.isStringLiteral(node.moduleSpecifier)) {
// export * from "foo";
setColor(node, NodeColor.Black); setColor(node, NodeColor.Black);
enqueueImport(node, node.moduleSpecifier.text); enqueueImport(node, node.moduleSpecifier.text);
} }
if (node.exportClause && ts.isNamedExports(node.exportClause)) {
for (const exportSpecifier of node.exportClause.elements) {
export_import_queue.push(exportSpecifier);
}
}
return; return;
} }
@@ -475,7 +501,7 @@ function markNodes(languageService: ts.LanguageService, options: ITreeShakingOpt
} }
if (black_queue.length === 0) { if (black_queue.length === 0) {
for (let i = 0; i< gray_queue.length; i++) { for (let i = 0; i < gray_queue.length; i++) {
const node = gray_queue[i]; const node = gray_queue[i];
const nodeParent = node.parent; const nodeParent = node.parent;
if ((ts.isClassDeclaration(nodeParent) || ts.isInterfaceDeclaration(nodeParent)) && nodeOrChildIsBlack(nodeParent)) { if ((ts.isClassDeclaration(nodeParent) || ts.isInterfaceDeclaration(nodeParent)) && nodeOrChildIsBlack(nodeParent)) {
@@ -521,6 +547,7 @@ function markNodes(languageService: ts.LanguageService, options: ITreeShakingOpt
|| ts.isConstructSignatureDeclaration(member) || ts.isConstructSignatureDeclaration(member)
|| ts.isIndexSignatureDeclaration(member) || ts.isIndexSignatureDeclaration(member)
|| ts.isCallSignatureDeclaration(member) || ts.isCallSignatureDeclaration(member)
|| memberName === '[Symbol.iterator]'
|| memberName === 'toJSON' || memberName === 'toJSON'
|| memberName === 'toString' || memberName === 'toString'
|| memberName === 'dispose'// TODO: keeping all `dispose` methods || memberName === 'dispose'// TODO: keeping all `dispose` methods
@@ -545,6 +572,23 @@ function markNodes(languageService: ts.LanguageService, options: ITreeShakingOpt
}; };
node.forEachChild(loop); node.forEachChild(loop);
} }
while (export_import_queue.length > 0) {
const node = export_import_queue.shift()!;
if (nodeOrParentIsBlack(node)) {
continue;
}
const symbol: ts.Symbol | undefined = (<any>node).symbol;
if (!symbol) {
continue;
}
const aliased = checker.getAliasedSymbol(symbol);
if (aliased.declarations && aliased.declarations.length > 0) {
if (nodeOrParentIsBlack(aliased.declarations[0]) || nodeOrChildIsBlack(aliased.declarations[0])) {
setColor(node, NodeColor.Black);
}
}
}
} }
function nodeIsInItsOwnDeclaration(nodeSourceFile: ts.SourceFile, node: ts.Node, symbol: ts.Symbol): boolean { function nodeIsInItsOwnDeclaration(nodeSourceFile: ts.SourceFile, node: ts.Node, symbol: ts.Symbol): boolean {
@@ -646,6 +690,22 @@ function generateResult(languageService: ts.LanguageService, shakeLevel: ShakeLe
} }
} }
if (ts.isExportDeclaration(node)) {
if (node.exportClause && node.moduleSpecifier && ts.isNamedExports(node.exportClause)) {
let survivingExports: string[] = [];
for (const exportSpecifier of node.exportClause.elements) {
if (getColor(exportSpecifier) === NodeColor.Black) {
survivingExports.push(exportSpecifier.getFullText(sourceFile));
}
}
const leadingTriviaWidth = node.getLeadingTriviaWidth();
const leadingTrivia = sourceFile.text.substr(node.pos, leadingTriviaWidth);
if (survivingExports.length > 0) {
return write(`${leadingTrivia}export {${survivingExports.join(',')} } from${node.moduleSpecifier.getFullText(sourceFile)};`);
}
}
}
if (shakeLevel === ShakeLevel.ClassMembers && (ts.isClassDeclaration(node) || ts.isInterfaceDeclaration(node)) && nodeOrChildIsBlack(node)) { if (shakeLevel === ShakeLevel.ClassMembers && (ts.isClassDeclaration(node) || ts.isInterfaceDeclaration(node)) && nodeOrChildIsBlack(node)) {
let toWrite = node.getFullText(); let toWrite = node.getFullText();
for (let i = node.members.length - 1; i >= 0; i--) { for (let i = node.members.length - 1; i >= 0; i--) {
@@ -708,7 +768,7 @@ function getRealNodeSymbol(checker: ts.TypeChecker, node: ts.Node): [ts.Symbol |
// (2) when the aliased symbol is originating from an import. // (2) when the aliased symbol is originating from an import.
// //
function shouldSkipAlias(node: ts.Node, declaration: ts.Node): boolean { function shouldSkipAlias(node: ts.Node, declaration: ts.Node): boolean {
if (node.kind !== ts.SyntaxKind.Identifier) { if (!ts.isShorthandPropertyAssignment(node) && node.kind !== ts.SyntaxKind.Identifier) {
return false; return false;
} }
if (node.parent === declaration) { if (node.parent === declaration) {
@@ -733,7 +793,12 @@ function getRealNodeSymbol(checker: ts.TypeChecker, node: ts.Node): [ts.Symbol |
const { parent } = node; const { parent } = node;
let symbol = checker.getSymbolAtLocation(node); let symbol = (
ts.isShorthandPropertyAssignment(node)
? checker.getShorthandAssignmentValueSymbol(node)
: checker.getSymbolAtLocation(node)
);
let importNode: ts.Declaration | null = null; let importNode: ts.Declaration | null = null;
// If this is an alias, and the request came at the declaration location // If this is an alias, and the request came at the declaration location
// get the aliased symbol instead. This allows for goto def on an import e.g. // get the aliased symbol instead. This allows for goto def on an import e.g.
+1
View File
@@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
'use strict'; 'use strict';
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.streamToPromise = exports.versionStringToNumber = exports.filter = exports.rebase = exports.getVersion = exports.ensureDir = exports.rreddir = exports.rimraf = exports.stripSourceMappingURL = exports.loadSourcemaps = exports.cleanNodeModules = exports.skipDirectories = exports.toFileUri = exports.setExecutableBit = exports.fixWin32DirectoryPermissions = exports.incremental = void 0;
const es = require("event-stream"); const es = require("event-stream");
const debounce = require("debounce"); const debounce = require("debounce");
const _filter = require("gulp-filter"); const _filter = require("gulp-filter");
-26
View File
@@ -33,32 +33,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
END OF nodejs path library NOTICES AND INFORMATION END OF nodejs path library NOTICES AND INFORMATION
%% promise-polyfill version 8.1.0 (https://github.com/taylorhakes/promise-polyfill)
=========================================
Copyright (c) 2014 Taylor Hakes
Copyright (c) 2014 Forbes Lindesay
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
=========================================
END OF winjs NOTICES AND INFORMATION
%% string_scorer version 0.1.20 (https://github.com/joshaven/string_score) %% string_scorer version 0.1.20 (https://github.com/joshaven/string_score)
+1
View File
@@ -4,6 +4,7 @@
* Licensed under the Source EULA. See License.txt in the project root for license information. * Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.execute = exports.run3 = exports.DeclarationResolver = exports.FSProvider = exports.RECIPE_PATH = void 0;
const fs = require("fs"); const fs = require("fs");
const ts = require("typescript"); const ts = require("typescript");
const path = require("path"); const path = require("path");
+1 -1
View File
@@ -50,7 +50,7 @@
"rollup-plugin-node-resolve": "^5.2.0", "rollup-plugin-node-resolve": "^5.2.0",
"service-downloader": "0.2.1", "service-downloader": "0.2.1",
"terser": "4.3.8", "terser": "4.3.8",
"typescript": "3.8.2", "typescript": "3.9.0-dev.20200304",
"vsce": "1.48.0", "vsce": "1.48.0",
"vscode-telemetry-extractor": "^1.5.4", "vscode-telemetry-extractor": "^1.5.4",
"xml2js": "^0.4.17" "xml2js": "^0.4.17"
+4 -4
View File
@@ -3676,10 +3676,10 @@ typed-rest-client@^0.9.0:
tunnel "0.0.4" tunnel "0.0.4"
underscore "1.8.3" underscore "1.8.3"
typescript@3.8.2: typescript@3.9.0-dev.20200304:
version "3.8.2" version "3.9.0-dev.20200304"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.2.tgz#91d6868aaead7da74f493c553aeff76c0c0b1d5a" resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.0-dev.20200304.tgz#3cc35357eff29dc5604b4fa56d6597e13daf86ed"
integrity sha512-EgOVgL/4xfVrCMbhYKUQTdF37SQn4Iw73H5BgCrF1Abdun7Kwy/QZsE/ssAy0y4LxBbvua3PIbFsbRczWWnDdQ== integrity sha512-eUip/GgJmjp4qtHiJDxVhE5SDDiPzBUg7KBAFUgb7HgL/tv10JAHej7fnS1i+7xrq1eDtbkJyPaYOVnhL9db7Q==
typescript@^3.0.1: typescript@^3.0.1:
version "3.5.3" version "3.5.3"
+5 -1
View File
@@ -35,9 +35,13 @@
"url": "vscode://schemas/language-configuration" "url": "vscode://schemas/language-configuration"
}, },
{ {
"fileMatch": "*icon-theme.json", "fileMatch": ["*icon-theme.json", "!*product-icon-theme.json"],
"url": "vscode://schemas/icon-theme" "url": "vscode://schemas/icon-theme"
}, },
{
"fileMatch": "*product-icon-theme.json",
"url": "vscode://schemas/product-icon-theme"
},
{ {
"fileMatch": "*color-theme.json", "fileMatch": "*color-theme.json",
"url": "vscode://schemas/color-theme" "url": "vscode://schemas/color-theme"
+18 -72
View File
@@ -40,10 +40,7 @@
"command": "git.init", "command": "git.init",
"title": "%command.init%", "title": "%command.init%",
"category": "Git", "category": "Git",
"icon": { "icon": "$(add)"
"light": "resources/icons/light/git.svg",
"dark": "resources/icons/dark/git.svg"
}
}, },
{ {
"command": "git.openRepository", "command": "git.openRepository",
@@ -59,37 +56,25 @@
"command": "git.refresh", "command": "git.refresh",
"title": "%command.refresh%", "title": "%command.refresh%",
"category": "Git", "category": "Git",
"icon": { "icon": "$(refresh)"
"light": "resources/icons/light/refresh.svg",
"dark": "resources/icons/dark/refresh.svg"
}
}, },
{ {
"command": "git.openChange", "command": "git.openChange",
"title": "%command.openChange%", "title": "%command.openChange%",
"category": "Git", "category": "Git",
"icon": { "icon": "$(compare-changes)"
"light": "resources/icons/light/open-change.svg",
"dark": "resources/icons/dark/open-change.svg"
}
}, },
{ {
"command": "git.openFile", "command": "git.openFile",
"title": "%command.openFile%", "title": "%command.openFile%",
"category": "Git", "category": "Git",
"icon": { "icon": "$(go-to-file)"
"light": "resources/icons/light/open-file.svg",
"dark": "resources/icons/dark/open-file.svg"
}
}, },
{ {
"command": "git.openFile2", "command": "git.openFile2",
"title": "%command.openFile%", "title": "%command.openFile%",
"category": "Git", "category": "Git",
"icon": { "icon": "$(go-to-file)"
"light": "resources/icons/light/open-file.svg",
"dark": "resources/icons/dark/open-file.svg"
}
}, },
{ {
"command": "git.openHEADFile", "command": "git.openHEADFile",
@@ -100,37 +85,25 @@
"command": "git.stage", "command": "git.stage",
"title": "%command.stage%", "title": "%command.stage%",
"category": "Git", "category": "Git",
"icon": { "icon": "$(add)"
"light": "resources/icons/light/stage.svg",
"dark": "resources/icons/dark/stage.svg"
}
}, },
{ {
"command": "git.stageAll", "command": "git.stageAll",
"title": "%command.stageAll%", "title": "%command.stageAll%",
"category": "Git", "category": "Git",
"icon": { "icon": "$(add)"
"light": "resources/icons/light/stage.svg",
"dark": "resources/icons/dark/stage.svg"
}
}, },
{ {
"command": "git.stageAllTracked", "command": "git.stageAllTracked",
"title": "%command.stageAllTracked%", "title": "%command.stageAllTracked%",
"category": "Git", "category": "Git",
"icon": { "icon": "$(add)"
"light": "resources/icons/light/stage.svg",
"dark": "resources/icons/dark/stage.svg"
}
}, },
{ {
"command": "git.stageAllUntracked", "command": "git.stageAllUntracked",
"title": "%command.stageAllUntracked%", "title": "%command.stageAllUntracked%",
"category": "Git", "category": "Git",
"icon": { "icon": "$(add)"
"light": "resources/icons/light/stage.svg",
"dark": "resources/icons/dark/stage.svg"
}
}, },
{ {
"command": "git.stageSelectedRanges", "command": "git.stageSelectedRanges",
@@ -146,37 +119,25 @@
"command": "git.stageChange", "command": "git.stageChange",
"title": "%command.stageChange%", "title": "%command.stageChange%",
"category": "Git", "category": "Git",
"icon": { "icon": "$(add)"
"light": "resources/icons/light/stage.svg",
"dark": "resources/icons/dark/stage.svg"
}
}, },
{ {
"command": "git.revertChange", "command": "git.revertChange",
"title": "%command.revertChange%", "title": "%command.revertChange%",
"category": "Git", "category": "Git",
"icon": { "icon": "$(discard)"
"light": "resources/icons/light/clean.svg",
"dark": "resources/icons/dark/clean.svg"
}
}, },
{ {
"command": "git.unstage", "command": "git.unstage",
"title": "%command.unstage%", "title": "%command.unstage%",
"category": "Git", "category": "Git",
"icon": { "icon": "$(remove)"
"light": "resources/icons/light/unstage.svg",
"dark": "resources/icons/dark/unstage.svg"
}
}, },
{ {
"command": "git.unstageAll", "command": "git.unstageAll",
"title": "%command.unstageAll%", "title": "%command.unstageAll%",
"category": "Git", "category": "Git",
"icon": { "icon": "$(remove)"
"light": "resources/icons/light/unstage.svg",
"dark": "resources/icons/dark/unstage.svg"
}
}, },
{ {
"command": "git.unstageSelectedRanges", "command": "git.unstageSelectedRanges",
@@ -187,46 +148,31 @@
"command": "git.clean", "command": "git.clean",
"title": "%command.clean%", "title": "%command.clean%",
"category": "Git", "category": "Git",
"icon": { "icon": "$(discard)"
"light": "resources/icons/light/clean.svg",
"dark": "resources/icons/dark/clean.svg"
}
}, },
{ {
"command": "git.cleanAll", "command": "git.cleanAll",
"title": "%command.cleanAll%", "title": "%command.cleanAll%",
"category": "Git", "category": "Git",
"icon": { "icon": "$(discard)"
"light": "resources/icons/light/clean.svg",
"dark": "resources/icons/dark/clean.svg"
}
}, },
{ {
"command": "git.cleanAllTracked", "command": "git.cleanAllTracked",
"title": "%command.cleanAllTracked%", "title": "%command.cleanAllTracked%",
"category": "Git", "category": "Git",
"icon": { "icon": "$(discard)"
"light": "resources/icons/light/clean.svg",
"dark": "resources/icons/dark/clean.svg"
}
}, },
{ {
"command": "git.cleanAllUntracked", "command": "git.cleanAllUntracked",
"title": "%command.cleanAllUntracked%", "title": "%command.cleanAllUntracked%",
"category": "Git", "category": "Git",
"icon": { "icon": "$(discard)"
"light": "resources/icons/light/clean.svg",
"dark": "resources/icons/dark/clean.svg"
}
}, },
{ {
"command": "git.commit", "command": "git.commit",
"title": "%command.commit%", "title": "%command.commit%",
"category": "Git", "category": "Git",
"icon": { "icon": "$(check)"
"light": "resources/icons/light/check.svg",
"dark": "resources/icons/dark/check.svg"
}
}, },
{ {
"command": "git.commitStaged", "command": "git.commitStaged",
@@ -1,3 +0,0 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.4315 3.32315L5.96154 13.3232L5.17083 13.2874L1.82083 8.51736L2.63918 7.94263L5.617 12.1827L13.6685 2.67683L14.4315 3.32315Z" fill="#C5C5C5"/>
</svg>

Before

Width:  |  Height:  |  Size: 298 B

@@ -1,3 +0,0 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.5 2V5.5L4 6H7.5V5H4.979L5.92041 4.05869C7.30762 2.67157 9.55664 2.67157 10.9434 4.05869C12.3306 5.4458 12.3306 7.69476 10.9434 9.08188L5.74561 14.2799L6.46582 14.9999L11.6636 9.80194C13.4482 8.01715 13.4482 5.12341 11.6636 3.33859C9.87891 1.5538 6.98486 1.5538 5.2002 3.33859L4.5 4.03882V2H3.5Z" fill="#C5C5C5"/>
</svg>

Before

Width:  |  Height:  |  Size: 468 B

@@ -1,3 +0,0 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14 7V8H8V14H7V8H1V7H7V1H8V7H14Z" fill="#C5C5C5"/>
</svg>

Before

Width:  |  Height:  |  Size: 163 B

@@ -1,3 +0,0 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.88465 1.69445L8.57246 3H11.346C11.5656 3 11.783 3.04327 11.9858 3.12734C12.1886 3.2114 12.3729 3.33461 12.5281 3.48993C12.6833 3.64525 12.8063 3.82963 12.8902 4.03253C12.9741 4.23543 13.0172 4.45287 13.017 4.67243L12.517 4.672H13.017V4.67243V10.4539C13.8823 10.6794 14.521 11.4661 14.521 12.402C14.521 13.5138 13.6198 14.415 12.508 14.415C11.3963 14.415 10.495 13.5138 10.495 12.402C10.495 11.4596 11.1426 10.6685 12.017 10.4493V4.672V4.67158C12.0171 4.58341 11.9998 4.4961 11.9661 4.41462C11.9324 4.33314 11.883 4.25911 11.8207 4.19674C11.7584 4.13437 11.6844 4.08489 11.6029 4.05114C11.5215 4.01738 11.4342 4 11.346 4H8.53857L9.83833 5.34332L9.11967 6.03868L7.00067 3.84868L7.00735 3.14655L9.17935 0.98555L9.88465 1.69445ZM11.495 12.402C11.495 11.8425 11.9485 11.389 12.508 11.389C13.0675 11.389 13.521 11.8425 13.521 12.402C13.521 12.9615 13.0675 13.415 12.508 13.415C11.9485 13.415 11.495 12.9615 11.495 12.402ZM2.499 3.513C2.499 2.95354 2.95254 2.5 3.512 2.5C4.07147 2.5 4.525 2.95354 4.525 3.513C4.525 4.07247 4.07147 4.526 3.512 4.526C2.95254 4.526 2.499 4.07247 2.499 3.513ZM3.512 1.5C2.40025 1.5 1.499 2.40125 1.499 3.513C1.499 4.44783 2.13622 5.23382 3 5.46031V11.307C3 11.7502 3.17605 12.1752 3.48942 12.4886C3.8028 12.802 4.22782 12.978 4.671 12.978H7.44813L6.13543 14.2835L6.84057 14.9925L9.01257 12.8325L9.01941 12.1304L6.90041 9.93939L6.18159 10.6346L7.48086 11.978H4.671C4.49304 11.978 4.32237 11.9073 4.19653 11.7815C4.07069 11.6556 4 11.485 4 11.307V5.46645C4.87595 5.24833 5.525 4.45646 5.525 3.513C5.525 2.40125 4.62375 1.5 3.512 1.5Z" fill="#C5C5C5"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.7 KiB

@@ -1,3 +0,0 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.06065 3.85356L5.91421 6L5.2071 5.29289L6.49999 4H3.5C3.10218 4 2.72064 4.15804 2.43934 4.43934C2.15804 4.72065 2 5.10218 2 5.5C2 5.89783 2.15804 6.27936 2.43934 6.56066C2.72064 6.84197 3.10218 7 3.5 7H4V8H3.5C2.83696 8 2.20107 7.73661 1.73223 7.26777C1.26339 6.79893 1 6.16305 1 5.5C1 4.83696 1.26339 4.20108 1.73223 3.73224C2.20107 3.2634 2.83696 3 3.5 3H6.49999L6.49999 3H6.49996L6 2.50004V2.50001L5.2071 1.70711L5.91421 1L8.06065 3.14645L8.06065 3.85356ZM5 6.50003L5.91421 7.41424L6 7.32845V14H14V7H10V3H9.06065V2.73227L8.32838 2H11.2L11.5 2.1L14.9 5.6L15 6V14.5L14.5 15H5.5L5 14.5V9.00003V6.50003ZM11 3V6H13.9032L11 3Z" fill="#C5C5C5"/>
</svg>

Before

Width:  |  Height:  |  Size: 796 B

@@ -1,4 +0,0 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.56253 2.51577C3.46348 3.4501 2 5.55414 2 7.99999C2 11.3137 4.68629 14 8 14C11.3137 14 14 11.3137 14 7.99999C14 5.32519 12.2497 3.05919 9.83199 2.28482L9.52968 3.23832C11.5429 3.88454 13 5.7721 13 7.99999C13 10.7614 10.7614 13 8 13C5.23858 13 3 10.7614 3 7.99999C3 6.31104 3.83742 4.81767 5.11969 3.91245L5.56253 2.51577Z" fill="#C5C5C5"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M5 3H2V2H5.5L6 2.5V6H5V3Z" fill="#C5C5C5"/>
</svg>

Before

Width:  |  Height:  |  Size: 587 B

@@ -1,3 +0,0 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14 7V8H8V14H7V8H1V7H7V1H8V7H14Z" fill="#C5C5C5"/>
</svg>

Before

Width:  |  Height:  |  Size: 163 B

@@ -1,3 +0,0 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M15 8H1V7H15V8Z" fill="#C5C5C5"/>
</svg>

Before

Width:  |  Height:  |  Size: 146 B

@@ -1,3 +0,0 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M14.4315 3.32317L5.96154 13.3232L5.17083 13.2874L1.82083 8.51737L2.63918 7.94264L5.617 12.1827L13.6685 2.67685L14.4315 3.32317Z" fill="#424242"/>
</svg>

Before

Width:  |  Height:  |  Size: 298 B

@@ -1,3 +0,0 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.5 2V5.5L4 6H7.5V5H4.979L5.92041 4.05869C7.30762 2.67157 9.55664 2.67157 10.9434 4.05869C12.3306 5.4458 12.3306 7.69476 10.9434 9.08188L5.74561 14.2799L6.46582 14.9999L11.6636 9.80194C13.4482 8.01715 13.4482 5.12341 11.6636 3.33859C9.87891 1.5538 6.98486 1.5538 5.2002 3.33859L4.5 4.03882V2H3.5Z" fill="#424242"/>
</svg>

Before

Width:  |  Height:  |  Size: 468 B

@@ -1,3 +0,0 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14 7V8H8V14H7V8H1V7H7V1H8V7H14Z" fill="#424242"/>
</svg>

Before

Width:  |  Height:  |  Size: 163 B

@@ -1,3 +0,0 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M9.88465 1.69445L8.57246 3H11.346C11.5656 3 11.783 3.04327 11.9858 3.12734C12.1886 3.2114 12.3729 3.33461 12.5281 3.48993C12.6833 3.64525 12.8063 3.82963 12.8902 4.03253C12.9741 4.23543 13.0172 4.45287 13.017 4.67243L12.517 4.672H13.017V4.67243V10.4539C13.8823 10.6794 14.521 11.4661 14.521 12.402C14.521 13.5138 13.6198 14.415 12.508 14.415C11.3963 14.415 10.495 13.5138 10.495 12.402C10.495 11.4596 11.1426 10.6685 12.017 10.4493V4.672V4.67158C12.0171 4.58341 11.9998 4.4961 11.9661 4.41462C11.9324 4.33314 11.883 4.25911 11.8207 4.19674C11.7584 4.13437 11.6844 4.08489 11.6029 4.05114C11.5215 4.01738 11.4342 4 11.346 4H8.53857L9.83833 5.34332L9.11967 6.03868L7.00067 3.84868L7.00735 3.14655L9.17935 0.98555L9.88465 1.69445ZM11.495 12.402C11.495 11.8425 11.9485 11.389 12.508 11.389C13.0675 11.389 13.521 11.8425 13.521 12.402C13.521 12.9615 13.0675 13.415 12.508 13.415C11.9485 13.415 11.495 12.9615 11.495 12.402ZM2.499 3.513C2.499 2.95354 2.95254 2.5 3.512 2.5C4.07147 2.5 4.525 2.95354 4.525 3.513C4.525 4.07247 4.07147 4.526 3.512 4.526C2.95254 4.526 2.499 4.07247 2.499 3.513ZM3.512 1.5C2.40025 1.5 1.499 2.40125 1.499 3.513C1.499 4.44783 2.13622 5.23382 3 5.46031V11.307C3 11.7502 3.17605 12.1752 3.48942 12.4886C3.8028 12.802 4.22782 12.978 4.671 12.978H7.44813L6.13543 14.2835L6.84057 14.9925L9.01257 12.8325L9.01941 12.1304L6.90041 9.93939L6.18159 10.6346L7.48086 11.978H4.671C4.49304 11.978 4.32237 11.9073 4.19653 11.7815C4.07069 11.6556 4 11.485 4 11.307V5.46645C4.87595 5.24833 5.525 4.45646 5.525 3.513C5.525 2.40125 4.62375 1.5 3.512 1.5Z" fill="#424242"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.7 KiB

@@ -1,3 +0,0 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.06065 3.85356L5.91421 6L5.2071 5.29289L6.49999 4H3.5C3.10218 4 2.72064 4.15804 2.43934 4.43934C2.15804 4.72065 2 5.10218 2 5.5C2 5.89783 2.15804 6.27936 2.43934 6.56066C2.72064 6.84197 3.10218 7 3.5 7H4V8H3.5C2.83696 8 2.20107 7.73661 1.73223 7.26777C1.26339 6.79893 1 6.16305 1 5.5C1 4.83696 1.26339 4.20108 1.73223 3.73224C2.20107 3.2634 2.83696 3 3.5 3H6.49999L6.49999 3H6.49996L6 2.50004V2.50001L5.2071 1.70711L5.91421 1L8.06065 3.14645L8.06065 3.85356ZM5 6.50003L5.91421 7.41424L6 7.32845V14H14V7H10V3H9.06065V2.73227L8.32838 2H11.2L11.5 2.1L14.9 5.6L15 6V14.5L14.5 15H5.5L5 14.5V9.00003V6.50003ZM11 3V6H13.9032L11 3Z" fill="#424242"/>
</svg>

Before

Width:  |  Height:  |  Size: 796 B

@@ -1,4 +0,0 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.56253 2.51577C3.46348 3.4501 2 5.55414 2 7.99999C2 11.3137 4.68629 14 8 14C11.3137 14 14 11.3137 14 7.99999C14 5.32519 12.2497 3.05919 9.83199 2.28482L9.52968 3.23832C11.5429 3.88454 13 5.7721 13 7.99999C13 10.7614 10.7614 13 8 13C5.23858 13 3 10.7614 3 7.99999C3 6.31104 3.83742 4.81767 5.11969 3.91245L5.56253 2.51577Z" fill="#424242"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M5 3H2V2H5.5L6 2.5V6H5V3Z" fill="#424242"/>
</svg>

Before

Width:  |  Height:  |  Size: 587 B

@@ -1,3 +0,0 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M14 7V8H8V14H7V8H1V7H7V1H8V7H14Z" fill="#424242"/>
</svg>

Before

Width:  |  Height:  |  Size: 163 B

@@ -1,3 +0,0 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M15 8H1V7H15V8Z" fill="#424242"/>
</svg>

Before

Width:  |  Height:  |  Size: 146 B

+5 -5
View File
@@ -80,7 +80,7 @@ export class GitTimelineProvider implements TimelineProvider {
constructor(private readonly _model: Model) { constructor(private readonly _model: Model) {
this._disposable = Disposable.from( this._disposable = Disposable.from(
_model.onDidOpenRepository(this.onRepositoriesChanged, this), _model.onDidOpenRepository(this.onRepositoriesChanged, this),
workspace.registerTimelineProvider('*', this), workspace.registerTimelineProvider(['file', 'git', 'gitlens-git'], this),
); );
} }
@@ -114,9 +114,9 @@ export class GitTimelineProvider implements TimelineProvider {
// TODO[ECA]: Ensure that the uri is a file -- if not we could get the history of the repo? // TODO[ECA]: Ensure that the uri is a file -- if not we could get the history of the repo?
let limit: number | undefined; let limit: number | undefined;
if (typeof options.limit === 'string') { if (options.limit !== undefined && typeof options.limit !== 'number') {
try { try {
const result = await this._model.git.exec(repo.root, ['rev-list', '--count', `${options.limit}..`, '--', uri.fsPath]); const result = await this._model.git.exec(repo.root, ['rev-list', '--count', `${options.limit.cursor}..`, '--', uri.fsPath]);
if (!result.exitCode) { if (!result.exitCode) {
// Ask for 1 more than so we can determine if there are more commits // Ask for 1 more than so we can determine if there are more commits
limit = Number(result.stdout) + 1; limit = Number(result.stdout) + 1;
@@ -182,7 +182,7 @@ export class GitTimelineProvider implements TimelineProvider {
const item = new GitTimelineItem('~', 'HEAD', localize('git.timeline.stagedChanges', 'Staged Changes'), date.getTime(), 'index', 'git:file:index'); const item = new GitTimelineItem('~', 'HEAD', localize('git.timeline.stagedChanges', 'Staged Changes'), date.getTime(), 'index', 'git:file:index');
// TODO[ECA]: Replace with a better icon -- reflecting its status maybe? // TODO[ECA]: Replace with a better icon -- reflecting its status maybe?
item.iconPath = new (ThemeIcon as any)('git-commit'); item.iconPath = new (ThemeIcon as any)('git-commit');
item.description = you; item.description = '';
item.detail = localize('git.timeline.detail', '{0} \u2014 {1}\n{2}\n\n{3}', you, localize('git.index', 'Index'), dateFormatter.format('MMMM Do, YYYY h:mma'), Resource.getStatusText(index.type)); item.detail = localize('git.timeline.detail', '{0} \u2014 {1}\n{2}\n\n{3}', you, localize('git.index', 'Index'), dateFormatter.format('MMMM Do, YYYY h:mma'), Resource.getStatusText(index.type));
item.command = { item.command = {
title: 'Open Comparison', title: 'Open Comparison',
@@ -201,7 +201,7 @@ export class GitTimelineProvider implements TimelineProvider {
const item = new GitTimelineItem('', index ? '~' : 'HEAD', localize('git.timeline.uncommitedChanges', 'Uncommited Changes'), date.getTime(), 'working', 'git:file:working'); const item = new GitTimelineItem('', index ? '~' : 'HEAD', localize('git.timeline.uncommitedChanges', 'Uncommited Changes'), date.getTime(), 'working', 'git:file:working');
// TODO[ECA]: Replace with a better icon -- reflecting its status maybe? // TODO[ECA]: Replace with a better icon -- reflecting its status maybe?
item.iconPath = new (ThemeIcon as any)('git-commit'); item.iconPath = new (ThemeIcon as any)('git-commit');
item.description = you; item.description = '';
item.detail = localize('git.timeline.detail', '{0} \u2014 {1}\n{2}\n\n{3}', you, localize('git.workingTree', 'Working Tree'), dateFormatter.format('MMMM Do, YYYY h:mma'), Resource.getStatusText(working.type)); item.detail = localize('git.timeline.detail', '{0} \u2014 {1}\n{2}\n\n{3}', you, localize('git.workingTree', 'Working Tree'), dateFormatter.format('MMMM Do, YYYY h:mma'), Resource.getStatusText(working.type));
item.command = { item.command = {
title: 'Open Comparison', title: 'Open Comparison',
@@ -40,8 +40,13 @@ export interface ISchemaAssociations {
[pattern: string]: string[]; [pattern: string]: string[];
} }
export interface ISchemaAssociation {
fileMatch: string[];
uri: string;
}
namespace SchemaAssociationNotification { namespace SchemaAssociationNotification {
export const type: NotificationType<ISchemaAssociations, any> = new NotificationType('json/schemaAssociations'); export const type: NotificationType<ISchemaAssociations | ISchemaAssociation[], any> = new NotificationType('json/schemaAssociations');
} }
namespace ResultLimitReachedNotification { namespace ResultLimitReachedNotification {
@@ -264,10 +269,10 @@ export function activate(context: ExtensionContext) {
toDispose.push(commands.registerCommand('_json.retryResolveSchema', handleRetryResolveSchemaCommand)); toDispose.push(commands.registerCommand('_json.retryResolveSchema', handleRetryResolveSchemaCommand));
client.sendNotification(SchemaAssociationNotification.type, getSchemaAssociation(context)); client.sendNotification(SchemaAssociationNotification.type, getSchemaAssociations(context));
extensions.onDidChange(_ => { extensions.onDidChange(_ => {
client.sendNotification(SchemaAssociationNotification.type, getSchemaAssociation(context)); client.sendNotification(SchemaAssociationNotification.type, getSchemaAssociations(context));
}); });
// manually register / deregister format provider based on the `html.format.enable` setting avoiding issues with late registration. See #71652. // manually register / deregister format provider based on the `html.format.enable` setting avoiding issues with late registration. See #71652.
@@ -324,8 +329,8 @@ export function deactivate(): Promise<any> {
return telemetryReporter ? telemetryReporter.dispose() : Promise.resolve(null); return telemetryReporter ? telemetryReporter.dispose() : Promise.resolve(null);
} }
function getSchemaAssociation(_context: ExtensionContext): ISchemaAssociations { function getSchemaAssociations(_context: ExtensionContext): ISchemaAssociation[] {
const associations: ISchemaAssociations = {}; const associations: ISchemaAssociation[] = [];
extensions.all.forEach(extension => { extensions.all.forEach(extension => {
const packageJSON = extension.packageJSON; const packageJSON = extension.packageJSON;
if (packageJSON && packageJSON.contributes && packageJSON.contributes.jsonValidation) { if (packageJSON && packageJSON.contributes && packageJSON.contributes.jsonValidation) {
@@ -333,23 +338,21 @@ function getSchemaAssociation(_context: ExtensionContext): ISchemaAssociations {
if (Array.isArray(jsonValidation)) { if (Array.isArray(jsonValidation)) {
jsonValidation.forEach(jv => { jsonValidation.forEach(jv => {
let { fileMatch, url } = jv; let { fileMatch, url } = jv;
if (fileMatch && url) { if (typeof fileMatch === 'string') {
if (url[0] === '.' && url[1] === '/') { fileMatch = [fileMatch];
url = Uri.file(path.join(extension.extensionPath, url)).toString(); }
} if (Array.isArray(fileMatch) && url) {
if (fileMatch[0] === '%') { fileMatch = fileMatch.map(fm => {
fileMatch = fileMatch.replace(/%APP_SETTINGS_HOME%/, '/User'); if (fm[0] === '%') {
fileMatch = fileMatch.replace(/%MACHINE_SETTINGS_HOME%/, '/Machine'); fm = fm.replace(/%APP_SETTINGS_HOME%/, '/User');
fileMatch = fileMatch.replace(/%APP_WORKSPACES_HOME%/, '/Workspaces'); fm = fm.replace(/%MACHINE_SETTINGS_HOME%/, '/Machine');
} else if (fileMatch.charAt(0) !== '/' && !fileMatch.match(/\w+:\/\//)) { fm = fm.replace(/%APP_WORKSPACES_HOME%/, '/Workspaces');
fileMatch = '/' + fileMatch; } else if (!fm.match(/^(\w+:\/\/|\/|!)/)) {
} fm = '/' + fm;
let association = associations[fileMatch]; }
if (!association) { return fm;
association = []; });
associations[fileMatch] = association; associations.push({ fileMatch, uri: url });
}
association.push(url);
} }
}); });
} }
@@ -3,7 +3,7 @@
"description": "Provides rich language support for JSON files.", "description": "Provides rich language support for JSON files.",
"json.schemas.desc": "Associate schemas to JSON files in the current project", "json.schemas.desc": "Associate schemas to JSON files in the current project",
"json.schemas.url.desc": "A URL to a schema or a relative path to a schema in the current directory", "json.schemas.url.desc": "A URL to a schema or a relative path to a schema in the current directory",
"json.schemas.fileMatch.desc": "An array of file patterns to match against when resolving JSON files to schemas.", "json.schemas.fileMatch.desc": "An array of file patterns to match against when resolving JSON files to schemas. `*` can be used as a wildcard. Exclusion patterns can also be defined and start with '!'. A file matches when there at least one matching pattern and the last matching pattern is not an exclusion pattern.",
"json.schemas.fileMatch.item.desc": "A file pattern that can contain '*' to match against when resolving JSON files to schemas.", "json.schemas.fileMatch.item.desc": "A file pattern that can contain '*' to match against when resolving JSON files to schemas.",
"json.schemas.schema.desc": "The schema definition for the given URL. The schema only needs to be provided to avoid accesses to the schema URL.", "json.schemas.schema.desc": "The schema definition for the given URL. The schema only needs to be provided to avoid accesses to the schema URL.",
"json.format.enable.desc": "Enable/disable default JSON formatter", "json.format.enable.desc": "Enable/disable default JSON formatter",
@@ -62,7 +62,7 @@ The server supports the following settings:
- `format` - `format`
- `enable`: Whether the server should register the formatting support. This option is only applicable if the client supports *dynamicRegistration* for *rangeFormatting* and `initializationOptions.provideFormatter` is not defined. - `enable`: Whether the server should register the formatting support. This option is only applicable if the client supports *dynamicRegistration* for *rangeFormatting* and `initializationOptions.provideFormatter` is not defined.
- `schema`: Configures association of file names to schema URL or schemas and/or associations of schema URL to schema content. - `schema`: Configures association of file names to schema URL or schemas and/or associations of schema URL to schema content.
- `fileMatch`: an array of file names or paths (separated by `/`). `*` can be used as a wildcard. - `fileMatch`: an array of file names or paths (separated by `/`). `*` can be used as a wildcard. Exclusion patterns can also be defined and start with '!'. A file matches when there at least one matching pattern and the last matching pattern is not an exclusion pattern.
- `url`: The URL of the schema, optional when also a schema is provided. - `url`: The URL of the schema, optional when also a schema is provided.
- `schema`: The schema content. - `schema`: The schema content.
- `resultLimit`: The max number foldig ranges and otline symbols to be computed (for performance reasons) - `resultLimit`: The max number foldig ranges and otline symbols to be computed (for performance reasons)
@@ -23,8 +23,13 @@ interface ISchemaAssociations {
[pattern: string]: string[]; [pattern: string]: string[];
} }
interface ISchemaAssociation {
fileMatch: string[];
uri: string;
}
namespace SchemaAssociationNotification { namespace SchemaAssociationNotification {
export const type: NotificationType<ISchemaAssociations, any> = new NotificationType('json/schemaAssociations'); export const type: NotificationType<ISchemaAssociations | ISchemaAssociation[], any> = new NotificationType('json/schemaAssociations');
} }
namespace VSCodeContentRequest { namespace VSCodeContentRequest {
@@ -230,7 +235,7 @@ namespace LimitExceededWarnings {
} }
let jsonConfigurationSettings: JSONSchemaSettings[] | undefined = undefined; let jsonConfigurationSettings: JSONSchemaSettings[] | undefined = undefined;
let schemaAssociations: ISchemaAssociations | undefined = undefined; let schemaAssociations: ISchemaAssociations | ISchemaAssociation[] | undefined = undefined;
let formatterRegistration: Thenable<Disposable> | null = null; let formatterRegistration: Thenable<Disposable> | null = null;
// The settings have changed. Is send on server activation as well. // The settings have changed. Is send on server activation as well.
@@ -291,12 +296,16 @@ function updateConfiguration() {
schemas: new Array<SchemaConfiguration>() schemas: new Array<SchemaConfiguration>()
}; };
if (schemaAssociations) { if (schemaAssociations) {
for (const pattern in schemaAssociations) { if (Array.isArray(schemaAssociations)) {
const association = schemaAssociations[pattern]; Array.prototype.push.apply(languageSettings.schemas, schemaAssociations);
if (Array.isArray(association)) { } else {
association.forEach(uri => { for (const pattern in schemaAssociations) {
languageSettings.schemas.push({ uri, fileMatch: [pattern] }); const association = schemaAssociations[pattern];
}); if (Array.isArray(association)) {
association.forEach(uri => {
languageSettings.schemas.push({ uri, fileMatch: [pattern] });
});
}
} }
} }
} }
@@ -4,7 +4,7 @@
"If you want to provide a fix or improvement, please create a pull request against the original repository.", "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." "Once accepted there, we are happy to receive an update request."
], ],
"version": "https://github.com/microsoft/vscode-markdown-tm-grammar/commit/8fbbc11a6bb917f287bbe21d0573454020599547", "version": "https://github.com/microsoft/vscode-markdown-tm-grammar/commit/7cf9aa7bb76c55428063383610edc0a631230d58",
"name": "Markdown", "name": "Markdown",
"scopeName": "text.html.markdown", "scopeName": "text.html.markdown",
"patterns": [ "patterns": [
@@ -2267,7 +2267,7 @@
"name": "meta.other.valid-ampersand.markdown" "name": "meta.other.valid-ampersand.markdown"
}, },
"bold": { "bold": {
"begin": "(?x) (\\*\\*(?=\\w)|(?<!\\w)\\*\\*|(?<!\\w)\\b__)(?=\\S) (?=\n (\n <[^>]*+> # HTML tags\n | (?<raw>`+)([^`]|(?!(?<!`)\\k<raw>(?!`))`)*+\\k<raw>\n # Raw\n | \\\\[\\\\`*_{}\\[\\]()#.!+\\->]?+ # Escapes\n | \\[\n (\n (?<square> # Named group\n [^\\[\\]\\\\] # Match most chars\n | \\\\. # Escaped chars\n | \\[ \\g<square>*+ \\] # Nested brackets\n )*+\n \\]\n (\n ( # Reference Link\n [ ]? # Optional space\n \\[[^\\]]*+\\] # Ref name\n )\n | ( # Inline Link\n \\( # Opening paren\n [ \\t]*+ # Optional whitespace\n <?(.*?)>? # URL\n [ \\t]*+ # Optional whitespace\n ( # Optional Title\n (?<title>['\"])\n (.*?)\n \\k<title>\n )?\n \\)\n )\n )\n )\n | (?!(?<=\\S)\\1). # Everything besides\n # style closer\n )++\n (?<=\\S)(?=__\\b|\\*\\*)\\1 # Close\n)\n", "begin": "(?x) (?<open>(\\*\\*(?=\\w)|(?<!\\w)\\*\\*|(?<!\\w)\\b__))(?=\\S) (?=\n (\n <[^>]*+> # HTML tags\n | (?<raw>`+)([^`]|(?!(?<!`)\\k<raw>(?!`))`)*+\\k<raw>\n # Raw\n | \\\\[\\\\`*_{}\\[\\]()#.!+\\->]?+ # Escapes\n | \\[\n (\n (?<square> # Named group\n [^\\[\\]\\\\] # Match most chars\n | \\\\. # Escaped chars\n | \\[ \\g<square>*+ \\] # Nested brackets\n )*+\n \\]\n (\n ( # Reference Link\n [ ]? # Optional space\n \\[[^\\]]*+\\] # Ref name\n )\n | ( # Inline Link\n \\( # Opening paren\n [ \\t]*+ # Optional whitespace\n <?(.*?)>? # URL\n [ \\t]*+ # Optional whitespace\n ( # Optional Title\n (?<title>['\"])\n (.*?)\n \\k<title>\n )?\n \\)\n )\n )\n )\n | (?!(?<=\\S)\\k<open>). # Everything besides\n # style closer\n )++\n (?<=\\S)(?=__\\b|\\*\\*)\\k<open> # Close\n)\n",
"captures": { "captures": {
"1": { "1": {
"name": "punctuation.definition.bold.markdown" "name": "punctuation.definition.bold.markdown"
@@ -2412,7 +2412,7 @@
"name": "meta.image.reference.markdown" "name": "meta.image.reference.markdown"
}, },
"italic": { "italic": {
"begin": "(?x) (\\*(?=\\w)|(?<!\\w)\\*|(?<!\\w)\\b_)(?=\\S) # Open\n (?=\n (\n <[^>]*+> # HTML tags\n | (?<raw>`+)([^`]|(?!(?<!`)\\k<raw>(?!`))`)*+\\k<raw>\n # Raw\n | \\\\[\\\\`*_{}\\[\\]()#.!+\\->]?+ # Escapes\n | \\[\n (\n (?<square> # Named group\n [^\\[\\]\\\\] # Match most chars\n | \\\\. # Escaped chars\n | \\[ \\g<square>*+ \\] # Nested brackets\n )*+\n \\]\n (\n ( # Reference Link\n [ ]? # Optional space\n \\[[^\\]]*+\\] # Ref name\n )\n | ( # Inline Link\n \\( # Opening paren\n [ \\t]*+ # Optional whtiespace\n <?(.*?)>? # URL\n [ \\t]*+ # Optional whtiespace\n ( # Optional Title\n (?<title>['\"])\n (.*?)\n \\k<title>\n )?\n \\)\n )\n )\n )\n | \\1\\1 # Must be bold closer\n | (?!(?<=\\S)\\1). # Everything besides\n # style closer\n )++\n (?<=\\S)(?=_\\b|\\*)\\1 # Close\n )\n", "begin": "(?x) (?<open>(\\*(?=\\w)|(?<!\\w)\\*|(?<!\\w)\\b_))(?=\\S) # Open\n (?=\n (\n <[^>]*+> # HTML tags\n | (?<raw>`+)([^`]|(?!(?<!`)\\k<raw>(?!`))`)*+\\k<raw>\n # Raw\n | \\\\[\\\\`*_{}\\[\\]()#.!+\\->]?+ # Escapes\n | \\[\n (\n (?<square> # Named group\n [^\\[\\]\\\\] # Match most chars\n | \\\\. # Escaped chars\n | \\[ \\g<square>*+ \\] # Nested brackets\n )*+\n \\]\n (\n ( # Reference Link\n [ ]? # Optional space\n \\[[^\\]]*+\\] # Ref name\n )\n | ( # Inline Link\n \\( # Opening paren\n [ \\t]*+ # Optional whtiespace\n <?(.*?)>? # URL\n [ \\t]*+ # Optional whtiespace\n ( # Optional Title\n (?<title>['\"])\n (.*?)\n \\k<title>\n )?\n \\)\n )\n )\n )\n | \\k<open>\\k<open> # Must be bold closer\n | (?!(?<=\\S)\\k<open>). # Everything besides\n # style closer\n )++\n (?<=\\S)(?=_\\b|\\*)\\k<open> # Close\n )\n",
"captures": { "captures": {
"1": { "1": {
"name": "punctuation.definition.italic.markdown" "name": "punctuation.definition.italic.markdown"
@@ -77,6 +77,9 @@ export default class MarkdownFoldingProvider implements vscode.FoldingRangeProvi
return token.map[1] > token.map[0]; return token.map[1] > token.map[0];
case 'html_block': case 'html_block':
if (isRegionMarker(token)) {
return false;
}
return token.map[1] > token.map[0] + 1; return token.map[1] > token.map[0] + 1;
default: default:
@@ -92,7 +95,7 @@ export default class MarkdownFoldingProvider implements vscode.FoldingRangeProvi
if (document.lineAt(end).isEmptyOrWhitespace && end >= start + 1) { if (document.lineAt(end).isEmptyOrWhitespace && end >= start + 1) {
end = end - 1; end = end - 1;
} }
return new vscode.FoldingRange(start, end); return new vscode.FoldingRange(start, end, listItem.type === 'html_block' && listItem.content.startsWith('<!--') ? vscode.FoldingRangeKind.Comment : undefined);
}); });
} }
} }
@@ -457,7 +457,10 @@ export class DynamicMarkdownPreview extends Disposable {
const folder = vscode.workspace.getWorkspaceFolder(base); const folder = vscode.workspace.getWorkspaceFolder(base);
if (folder) { if (folder) {
baseRoots.push(folder.uri); const workspaceRoots = vscode.workspace.workspaceFolders?.map(folder => folder.uri);
if (workspaceRoots) {
baseRoots.push(...workspaceRoots);
}
} else if (!base.scheme || base.scheme === 'file') { } else if (!base.scheme || base.scheme === 'file') {
baseRoots.push(vscode.Uri.file(path.dirname(base.fsPath))); baseRoots.push(vscode.Uri.file(path.dirname(base.fsPath)));
} }
@@ -52,7 +52,7 @@ class PreviewStore extends Disposable {
} }
} }
export class MarkdownPreviewManager extends Disposable implements vscode.WebviewPanelSerializer, vscode.CustomEditorProvider { export class MarkdownPreviewManager extends Disposable implements vscode.WebviewPanelSerializer, vscode.CustomTextEditorProvider {
private static readonly markdownPreviewActiveContextKey = 'markdownPreviewFocus'; private static readonly markdownPreviewActiveContextKey = 'markdownPreviewFocus';
private readonly _topmostLineMonitor = new TopmostLineMonitor(); private readonly _topmostLineMonitor = new TopmostLineMonitor();
@@ -152,8 +152,8 @@ export class MarkdownPreviewManager extends Disposable implements vscode.Webview
return {}; return {};
} }
public async resolveCustomEditor( public async resolveCustomTextEditor(
document: vscode.CustomDocument, document: vscode.TextDocument,
webview: vscode.WebviewPanel webview: vscode.WebviewPanel
): Promise<void> { ): Promise<void> {
const preview = DynamicMarkdownPreview.revive( const preview = DynamicMarkdownPreview.revive(
@@ -175,6 +175,18 @@ a`);
assert.strictEqual(firstFold.start, 1); assert.strictEqual(firstFold.start, 1);
assert.strictEqual(firstFold.end, 3); assert.strictEqual(firstFold.end, 3);
}); });
test('Should fold html block comments', async () => {
const folds = await getFoldsForDocument(`x
<!--
fa
-->`);
assert.strictEqual(folds.length, 1);
const firstFold = folds[0];
assert.strictEqual(firstFold.start, 1);
assert.strictEqual(firstFold.end, 3);
assert.strictEqual(firstFold.kind, vscode.FoldingRangeKind.Comment);
});
}); });
+1 -1
View File
@@ -3,7 +3,7 @@
"version": "0.0.1", "version": "0.0.1",
"description": "Dependencies shared by all extensions", "description": "Dependencies shared by all extensions",
"dependencies": { "dependencies": {
"typescript": "3.8.2" "typescript": "3.8.3"
}, },
"scripts": { "scripts": {
"postinstall": "node ./postinstall" "postinstall": "node ./postinstall"
+1 -1
View File
@@ -6,7 +6,7 @@
"git": { "git": {
"name": "MagicStack/MagicPython", "name": "MagicStack/MagicPython",
"repositoryUrl": "https://github.com/MagicStack/MagicPython", "repositoryUrl": "https://github.com/MagicStack/MagicPython",
"commitHash": "c0f8d514bbe6e9d3899f2b002bcd6971aef5e34b" "commitHash": "c9b3409deb69acec31bbf7913830e93a046b30cc"
} }
}, },
"license": "MIT", "license": "MIT",
@@ -4,7 +4,7 @@
"If you want to provide a fix or improvement, please create a pull request against the original repository.", "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." "Once accepted there, we are happy to receive an update request."
], ],
"version": "https://github.com/MagicStack/MagicPython/commit/c0f8d514bbe6e9d3899f2b002bcd6971aef5e34b", "version": "https://github.com/MagicStack/MagicPython/commit/c9b3409deb69acec31bbf7913830e93a046b30cc",
"name": "MagicPython", "name": "MagicPython",
"scopeName": "source.python", "scopeName": "source.python",
"patterns": [ "patterns": [
@@ -4,7 +4,7 @@
"If you want to provide a fix or improvement, please create a pull request against the original repository.", "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." "Once accepted there, we are happy to receive an update request."
], ],
"version": "https://github.com/MagicStack/MagicPython/commit/361a4964a559481330764a447e7bab88d4f1b01b", "version": "https://github.com/MagicStack/MagicPython/commit/c9b3409deb69acec31bbf7913830e93a046b30cc",
"name": "MagicRegExp", "name": "MagicRegExp",
"scopeName": "source.regexp.python", "scopeName": "source.regexp.python",
"patterns": [ "patterns": [
@@ -55,6 +55,7 @@ const mappings = [
['vb', 'source.asp.vb.net'], ['vb', 'source.asp.vb.net'],
['xml', 'text.xml'], ['xml', 'text.xml'],
['yaml', 'source.yaml'], ['yaml', 'source.yaml'],
['yml', 'source.yaml'],
]; ];
const scopes = { const scopes = {
@@ -113,8 +114,8 @@ mappings.forEach(([ext, scope, regexp]) =>
patterns: [ patterns: [
{ {
name: [scopes.resultBlock.result.meta, scopes.resultBlock.result.metaMultiLine].join(' '), name: [scopes.resultBlock.result.meta, scopes.resultBlock.result.metaMultiLine].join(' '),
begin: '^ ((\\d+) )', begin: '^ (?:\\s*)((\\d+) )',
while: '^ (?:((\\d+)(:))|((\\d+) ))', while: '^ (?:\\s*)(?:((\\d+)(:))|((\\d+) ))',
beginCaptures: { beginCaptures: {
'0': { name: scopes.resultBlock.result.prefix.meta }, '0': { name: scopes.resultBlock.result.prefix.meta },
'1': { name: scopes.resultBlock.result.prefix.metaContext }, '1': { name: scopes.resultBlock.result.prefix.metaContext },
@@ -132,7 +133,7 @@ mappings.forEach(([ext, scope, regexp]) =>
patterns: [{ include: scope }] patterns: [{ include: scope }]
}, },
{ {
begin: '^ ((\\d+)(:))', begin: '^ (?:\\s*)((\\d+)(:))',
while: '(?=not)possible', while: '(?=not)possible',
name: [scopes.resultBlock.result.meta, scopes.resultBlock.result.metaSingleLine].join(' '), name: [scopes.resultBlock.result.meta, scopes.resultBlock.result.metaSingleLine].join(' '),
beginCaptures: { beginCaptures: {
@@ -214,7 +215,7 @@ const plainText = [
} }
}, },
{ {
match: '^ (?:((\\d+)(:))|((\\d+)( ))(.*))', match: '^ (?:\\s*)(?:((\\d+)(:))|((\\d+)( ))(.*))',
name: [scopes.resultBlock.meta, scopes.resultBlock.result.meta].join(' '), name: [scopes.resultBlock.meta, scopes.resultBlock.result.meta].join(' '),
captures: { captures: {
'1': { name: [scopes.resultBlock.result.prefix.meta, scopes.resultBlock.result.prefix.metaMatch].join(' ') }, '1': { name: [scopes.resultBlock.result.prefix.meta, scopes.resultBlock.result.prefix.metaMatch].join(' ') },
File diff suppressed because it is too large Load Diff
@@ -55,6 +55,14 @@
"fontStyle": "bold" "fontStyle": "bold"
} }
} }
],
"productIconThemes": [
{
"id": "Test Product Icons",
"label": "The Test Product Icon Theme",
"path": "./producticons/test-product-icon-theme.json",
"_watch": true
}
] ]
} }
} }
File diff suppressed because it is too large Load Diff
@@ -1,5 +1,6 @@
Copyright (c) 2014 Taylor Hakes The MIT License (MIT)
Copyright (c) 2014 Forbes Lindesay
Copyright (c) <2013> <Elegant Themes, Inc.>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
@@ -17,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. THE SOFTWARE.
@@ -0,0 +1,43 @@
{
// ElegantIcons from https://www.elegantthemes.com/icons/elegant_font.zip
"fonts": [
{
"id": "elegant",
"src": [
{
"path": "./ElegantIcons.woff",
"format": "woff"
}
],
"weight": "normal",
"style": "normal",
}
],
"iconDefinitions": {
"chevron-down": {
"fontCharacter": "\\43",
},
"chevron-right": {
"fontCharacter": "\\45"
},
"error": {
"fontCharacter": "\\e062"
},
"warning": {
"fontCharacter": "\\e063"
},
"settings-gear": {
"fontCharacter": "\\e030"
},
"files": {
"fontCharacter": "\\e056"
},
"extensions": {
"fontCharacter": "\\e015"
},
"debug-alt-2": {
"fontCharacter": "\\e072"
}
}
}
+4 -4
View File
@@ -2,7 +2,7 @@
# yarn lockfile v1 # yarn lockfile v1
typescript@3.8.2: typescript@3.8.3:
version "3.8.2" version "3.8.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.2.tgz#91d6868aaead7da74f493c553aeff76c0c0b1d5a" resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.3.tgz#409eb8544ea0335711205869ec458ab109ee1061"
integrity sha512-EgOVgL/4xfVrCMbhYKUQTdF37SQn4Iw73H5BgCrF1Abdun7Kwy/QZsE/ssAy0y4LxBbvua3PIbFsbRczWWnDdQ== integrity sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w==
+1 -1
View File
@@ -179,7 +179,7 @@
"style-loader": "^1.0.0", "style-loader": "^1.0.0",
"ts-loader": "^4.4.2", "ts-loader": "^4.4.2",
"typemoq": "^0.3.2", "typemoq": "^0.3.2",
"typescript": "3.8.2", "typescript": "3.9.0-dev.20200304",
"typescript-formatter": "7.1.0", "typescript-formatter": "7.1.0",
"vinyl": "^2.0.0", "vinyl": "^2.0.0",
"vinyl-fs": "^3.0.0", "vinyl-fs": "^3.0.0",
+3
View File
@@ -8,6 +8,9 @@
const bootstrap = require('./bootstrap'); const bootstrap = require('./bootstrap');
// Remove global paths from the node module lookup
bootstrap.removeGlobalNodeModuleLookupPaths();
// Enable ASAR in our forked processes // Enable ASAR in our forked processes
bootstrap.enableASARSupport(); bootstrap.enableASARSupport();
+1 -1
View File
@@ -31,7 +31,7 @@ exports.load = function (modulePaths, resultCallback, options) {
const args = parseURLQueryArgs(); const args = parseURLQueryArgs();
/** /**
* // configuration: IWindowConfiguration * // configuration: INativeWindowConfiguration
* @type {{ * @type {{
* zoomLevel?: number, * zoomLevel?: number,
* extensionDevelopmentPath?: string[], * extensionDevelopmentPath?: string[],
+23
View File
@@ -53,6 +53,29 @@ exports.injectNodeModuleLookupPath = function (injectPath) {
}; };
//#endregion //#endregion
//#region Remove global paths from the node lookup paths
exports.removeGlobalNodeModuleLookupPaths = function() {
// @ts-ignore
const Module = require('module');
// @ts-ignore
const globalPaths = Module.globalPaths;
// @ts-ignore
const originalResolveLookupPaths = Module._resolveLookupPaths;
// @ts-ignore
Module._resolveLookupPaths = function (moduleName, parent) {
const paths = originalResolveLookupPaths(moduleName, parent);
let commonSuffixLength = 0;
while (commonSuffixLength < paths.length && paths[paths.length - 1 - commonSuffixLength] === globalPaths[globalPaths.length - 1 - commonSuffixLength]) {
commonSuffixLength++;
}
return paths.slice(0, paths.length - commonSuffixLength);
};
};
//#endregion
//#region Add support for using node_modules.asar //#region Add support for using node_modules.asar
/** /**
* @param {string=} nodeModulesPath * @param {string=} nodeModulesPath
+1 -1
View File
@@ -182,7 +182,7 @@ function configureCommandlineSwitchesSync(cliArgs) {
app.commandLine.appendSwitch('js-flags', jsFlags); app.commandLine.appendSwitch('js-flags', jsFlags);
} }
// TODO@Ben TODO@Deepak Electron 7 workaround for https://github.com/microsoft/vscode/issues/88873 // TODO@Deepak Electron 7 workaround for https://github.com/microsoft/vscode/issues/88873
app.commandLine.appendSwitch('disable-features', 'LayoutNG'); app.commandLine.appendSwitch('disable-features', 'LayoutNG');
return argvConfig; return argvConfig;
@@ -76,7 +76,7 @@ export class DropdownList extends Dropdown {
} }
})); }));
this._register(this._list.onSelectionChange(() => { this._register(this._list.onDidChangeSelection(() => {
// focus on the dropdown label then hide the dropdown list // focus on the dropdown label then hide the dropdown list
this.element.focus(); this.element.focus();
this.hide(); this.hide();
@@ -468,7 +468,7 @@ export class MainThreadNotebookDocumentsAndEditors extends Disposable implements
const model = this._untitledEditorService.create({ untitledResource: uri, mode: 'notebook', initialValue: options.initialContent }); const model = this._untitledEditorService.create({ untitledResource: uri, mode: 'notebook', initialValue: options.initialContent });
fileInput = this._instantiationService.createInstance(UntitledTextEditorInput, model); fileInput = this._instantiationService.createInstance(UntitledTextEditorInput, model);
} else { } else {
fileInput = this._editorService.createInput({ forceFile: true, resource: uri, mode: 'notebook' }) as FileEditorInput; fileInput = this._editorService.createEditorInput({ forceFile: true, resource: uri, mode: 'notebook' }) as FileEditorInput;
} }
} }
let input: NotebookInput; let input: NotebookInput;
@@ -38,7 +38,7 @@ export class MainThreadQueryEditor extends Disposable implements MainThreadQuery
public $connect(fileUri: string, connectionId: string): Thenable<void> { public $connect(fileUri: string, connectionId: string): Thenable<void> {
return new Promise<void>((resolve, reject) => { return new Promise<void>((resolve, reject) => {
let editors = this._editorService.visibleControls.filter(resource => { let editors = this._editorService.visibleEditorPanes.filter(resource => {
return !!resource && resource.input.resource.toString() === fileUri; return !!resource && resource.input.resource.toString() === fileUri;
}); });
let editor = editors && editors.length > 0 ? editors[0] : undefined; let editor = editors && editors.length > 0 ? editors[0] : undefined;
@@ -75,7 +75,7 @@ export class MainThreadQueryEditor extends Disposable implements MainThreadQuery
public $connectWithProfile(fileUri: string, connection: azdata.connection.ConnectionProfile): Thenable<void> { public $connectWithProfile(fileUri: string, connection: azdata.connection.ConnectionProfile): Thenable<void> {
return new Promise<void>(async (resolve, reject) => { return new Promise<void>(async (resolve, reject) => {
let editors = this._editorService.visibleControls.filter(resource => { let editors = this._editorService.visibleEditorPanes.filter(resource => {
return !!resource && resource.input.resource.toString() === fileUri; return !!resource && resource.input.resource.toString() === fileUri;
}); });
let editor = editors && editors.length > 0 ? editors[0] : undefined; let editor = editors && editors.length > 0 ? editors[0] : undefined;
@@ -97,7 +97,7 @@ export class MainThreadQueryEditor extends Disposable implements MainThreadQuery
} }
public $runQuery(fileUri: string, runCurrentQuery: boolean = true): void { public $runQuery(fileUri: string, runCurrentQuery: boolean = true): void {
let filteredEditors = this._editorService.visibleControls.filter(editor => editor.input.resource.toString() === fileUri); let filteredEditors = this._editorService.visibleEditorPanes.filter(editor => editor.input.resource.toString() === fileUri);
if (filteredEditors && filteredEditors.length > 0) { if (filteredEditors && filteredEditors.length > 0) {
let editor = filteredEditors[0]; let editor = filteredEditors[0];
if (editor instanceof QueryEditor) { if (editor instanceof QueryEditor) {
@@ -118,7 +118,7 @@ export class MainThreadQueryEditor extends Disposable implements MainThreadQuery
} }
public $createQueryTab(fileUri: string, title: string, componentId: string): void { public $createQueryTab(fileUri: string, title: string, componentId: string): void {
let editors = this._editorService.visibleControls.filter(resource => { let editors = this._editorService.visibleEditorPanes.filter(resource => {
return !!resource && resource.input.resource.toString() === fileUri; return !!resource && resource.input.resource.toString() === fileUri;
}); });
+3 -3
View File
@@ -20,13 +20,13 @@ import { localize } from 'vs/nls';
import { IThemeService } from 'vs/platform/theme/common/themeService'; import { IThemeService } from 'vs/platform/theme/common/themeService';
import { isUndefinedOrNull } from 'vs/base/common/types'; import { isUndefinedOrNull } from 'vs/base/common/types';
import { ILogService } from 'vs/platform/log/common/log'; import { ILogService } from 'vs/platform/log/common/log';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfigurationService'; import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfigurationService';
import { URI } from 'vs/base/common/uri'; import { URI } from 'vs/base/common/uri';
import { Schemas } from 'vs/base/common/network'; import { Schemas } from 'vs/base/common/network';
import { find, firstIndex } from 'vs/base/common/arrays'; import { find, firstIndex } from 'vs/base/common/arrays';
import { IThemable } from 'vs/base/common/styler'; import { IThemable } from 'vs/base/common/styler';
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry'; import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
export enum MessageLevel { export enum MessageLevel {
Error = 0, Error = 0,
@@ -151,7 +151,7 @@ export abstract class Modal extends Disposable implements IThemable {
private _title: string, private _title: string,
private _name: string, private _name: string,
private readonly _telemetryService: IAdsTelemetryService, private readonly _telemetryService: IAdsTelemetryService,
protected readonly layoutService: IWorkbenchLayoutService, protected readonly layoutService: ILayoutService,
protected readonly _clipboardService: IClipboardService, protected readonly _clipboardService: IClipboardService,
protected readonly _themeService: IThemeService, protected readonly _themeService: IThemeService,
protected readonly logService: ILogService, protected readonly logService: ILogService,
@@ -181,7 +181,7 @@ export abstract class Modal extends Disposable implements IThemable {
} }
this._bodyContainer = DOM.$(`.${builderClass}`, { role: 'dialog', 'aria-label': this._title }); this._bodyContainer = DOM.$(`.${builderClass}`, { role: 'dialog', 'aria-label': this._title });
const top = this.layoutService.getTitleBarOffset(); const top = this.layoutService.offset?.top ?? 0;
this._bodyContainer.style.top = `${top}px`; this._bodyContainer.style.top = `${top}px`;
this._modalDialog = DOM.append(this._bodyContainer, DOM.$('.modal-dialog')); this._modalDialog = DOM.append(this._bodyContainer, DOM.$('.modal-dialog'));
this._modalContent = DOM.append(this._modalDialog, DOM.$('.modal-content')); this._modalContent = DOM.append(this._modalDialog, DOM.$('.modal-content'));
@@ -27,9 +27,8 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { append, $ } from 'vs/base/browser/dom'; import { append, $ } from 'vs/base/browser/dom';
import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService'; import { IThemeService, IColorTheme } from 'vs/platform/theme/common/themeService';
import { ILogService } from 'vs/platform/log/common/log'; import { ILogService } from 'vs/platform/log/common/log';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfigurationService'; import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfigurationService';
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry'; import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
import { ViewPane, IViewPaneOptions } from 'vs/workbench/browser/parts/views/viewPaneContainer'; import { ViewPane, IViewPaneOptions } from 'vs/workbench/browser/parts/views/viewPaneContainer';
@@ -38,6 +37,7 @@ import { IViewDescriptorService } from 'vs/workbench/common/views';
import { ServiceOptionType } from 'sql/platform/connection/common/interfaces'; import { ServiceOptionType } from 'sql/platform/connection/common/interfaces';
import { IOpenerService } from 'vs/platform/opener/common/opener'; import { IOpenerService } from 'vs/platform/opener/common/opener';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
export class CategoryView extends ViewPane { export class CategoryView extends ViewPane {
@@ -98,7 +98,7 @@ export class OptionsDialog extends Modal {
title: string, title: string,
name: string, name: string,
options: IOptionsDialogOptions, options: IOptionsDialogOptions,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService, @ILayoutService layoutService: ILayoutService,
@IThemeService themeService: IThemeService, @IThemeService themeService: IThemeService,
@IContextViewService private _contextViewService: IContextViewService, @IContextViewService private _contextViewService: IContextViewService,
@IInstantiationService private _instantiationService: IInstantiationService, @IInstantiationService private _instantiationService: IInstantiationService,
@@ -123,8 +123,8 @@ export class OptionsDialog extends Modal {
// Theme styler // Theme styler
attachButtonStyler(okButton, this._themeService); attachButtonStyler(okButton, this._themeService);
attachButtonStyler(closeButton, this._themeService); attachButtonStyler(closeButton, this._themeService);
this._register(this._themeService.onThemeChange(e => this.updateTheme(e))); this._register(this._themeService.onDidColorThemeChange(e => this.updateTheme(e)));
this.updateTheme(this._themeService.getTheme()); this.updateTheme(this._themeService.getColorTheme());
} }
protected renderBody(container: HTMLElement) { protected renderBody(container: HTMLElement) {
@@ -142,7 +142,7 @@ export class OptionsDialog extends Modal {
} }
// Update theming that is specific to options dialog flyout body // Update theming that is specific to options dialog flyout body
private updateTheme(theme: ITheme): void { private updateTheme(theme: IColorTheme): void {
let borderColor = theme.getColor(contrastBorder); let borderColor = theme.getColor(contrastBorder);
let border = borderColor ? borderColor.toString() : null; let border = borderColor ? borderColor.toString() : null;
if (this._dividerBuilder) { if (this._dividerBuilder) {
@@ -239,7 +239,7 @@ export class OptionsDialog extends Modal {
this.fillInOptions(bodyContainer, serviceOptions); this.fillInOptions(bodyContainer, serviceOptions);
let viewSize = this._optionCategoryPadding + serviceOptions.length * this._optionRowSize; let viewSize = this._optionCategoryPadding + serviceOptions.length * this._optionRowSize;
let categoryView = this._instantiationService.createInstance(CategoryView, bodyContainer, viewSize, { title: category, ariaHeaderLabel: category, id: category }); let categoryView = this._instantiationService.createInstance(CategoryView, bodyContainer, viewSize, { title: category, id: category });
this.splitview.addView(categoryView, viewSize); this.splitview.addView(categoryView, viewSize);
categoryView.render(); categoryView.render();
attachPanelStyler(categoryView, this._themeService); attachPanelStyler(categoryView, this._themeService);
@@ -11,13 +11,14 @@ import {
import * as azdata from 'azdata'; import * as azdata from 'azdata';
import * as colors from 'vs/platform/theme/common/colorRegistry'; import * as colors from 'vs/platform/theme/common/colorRegistry';
import { IColorTheme, IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService'; import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { ComponentWithIconBase } from 'sql/workbench/browser/modelComponents/componentWithIconBase'; import { ComponentWithIconBase } from 'sql/workbench/browser/modelComponents/componentWithIconBase';
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent'; import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
import { KeyCode } from 'vs/base/common/keyCodes'; import { KeyCode } from 'vs/base/common/keyCodes';
import * as DOM from 'vs/base/browser/dom'; import * as DOM from 'vs/base/browser/dom';
import { IComponent, IComponentDescriptor, IModelStore, ComponentEventType } from 'sql/platform/dashboard/browser/interfaces'; import { IComponent, IComponentDescriptor, IModelStore, ComponentEventType } from 'sql/platform/dashboard/browser/interfaces';
import { IColorTheme } from 'vs/platform/theme/common/themeService';
export interface ActionDescriptor { export interface ActionDescriptor {
label: string; label: string;
@@ -68,7 +68,7 @@ export default class EditorComponent extends ComponentBase implements IComponent
this._editor.create(this._el.nativeElement); this._editor.create(this._el.nativeElement);
this._editor.setVisible(true); this._editor.setVisible(true);
let uri = this.createUri(); let uri = this.createUri();
this._editorInput = this.editorService.createInput({ forceUntitled: true, resource: uri, mode: 'plaintext' }) as UntitledTextEditorInput; this._editorInput = this.editorService.createEditorInput({ forceUntitled: true, resource: uri, mode: 'plaintext' }) as UntitledTextEditorInput;
await this._editor.setInput(this._editorInput, undefined); await this._editor.setInput(this._editorInput, undefined);
const model = await this._editorInput.resolve(); const model = await this._editorInput.resolve();
this._editorModel = model.textEditorModel; this._editorModel = model.textEditorModel;
@@ -19,7 +19,7 @@ import { memoize } from 'vs/base/common/decorators';
import { generateUuid } from 'vs/base/common/uuid'; import { generateUuid } from 'vs/base/common/uuid';
import { Event } from 'vs/base/common/event'; import { Event } from 'vs/base/common/event';
import { LayoutRequestParams } from 'sql/workbench/services/dialog/browser/dialogContainer.component'; import { LayoutRequestParams } from 'sql/workbench/services/dialog/browser/dialogContainer.component';
import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService'; import { IThemeService, IColorTheme } from 'vs/platform/theme/common/themeService';
import { ILogService } from 'vs/platform/log/common/log'; import { ILogService } from 'vs/platform/log/common/log';
import { IBootstrapParams } from 'sql/workbench/services/bootstrap/common/bootstrapParams'; import { IBootstrapParams } from 'sql/workbench/services/bootstrap/common/bootstrapParams';
import { IComponentDescriptor, IModelStore, IComponent } from 'sql/platform/dashboard/browser/interfaces'; import { IComponentDescriptor, IModelStore, IComponent } from 'sql/platform/dashboard/browser/interfaces';
@@ -75,11 +75,11 @@ export class ModelComponentWrapper extends AngularDisposable implements OnInit {
} }
ngOnInit() { ngOnInit() {
this._register(this.themeService.onThemeChange(event => this.updateTheme(event))); this._register(this.themeService.onDidColorThemeChange(event => this.updateTheme(event)));
} }
ngAfterViewInit() { ngAfterViewInit() {
this.updateTheme(this.themeService.getTheme()); this.updateTheme(this.themeService.getColorTheme());
if (this.componentHost) { if (this.componentHost) {
this.loadComponent(); this.loadComponent();
} }
@@ -148,7 +148,7 @@ export class ModelComponentWrapper extends AngularDisposable implements OnInit {
el.style.position = 'relative'; el.style.position = 'relative';
} }
private updateTheme(theme: ITheme): void { private updateTheme(theme: IColorTheme): void {
// TODO handle theming appropriately // TODO handle theming appropriately
let el = <HTMLElement>this._ref.nativeElement; let el = <HTMLElement>this._ref.nativeElement;
let backgroundColor = theme.getColor(colors.editorBackground, true); let backgroundColor = theme.getColor(colors.editorBackground, true);
@@ -126,7 +126,7 @@ export class QueryTextEditor extends BaseTextEditor {
return editorWidget.getScrollHeight(); return editorWidget.getScrollHeight();
} }
public setHeightToScrollHeight(configChanged?: boolean, isEditorCollapsed?: boolean, ) { public setHeightToScrollHeight(configChanged?: boolean, isEditorCollapsed?: boolean,) {
let editorWidget = this.getControl() as ICodeEditor; let editorWidget = this.getControl() as ICodeEditor;
let layoutInfo = editorWidget.getLayoutInfo(); let layoutInfo = editorWidget.getLayoutInfo();
if (!this._scrollbarHeight) { if (!this._scrollbarHeight) {
@@ -138,7 +138,7 @@ export class TreeComponentRenderer extends Disposable implements IRenderer {
* Render a element, given an object bag returned by the template * Render a element, given an object bag returned by the template
*/ */
public renderElement(tree: ITree, element: ITreeComponentItem, templateId: string, templateData: TreeDataTemplate): void { public renderElement(tree: ITree, element: ITreeComponentItem, templateId: string, templateData: TreeDataTemplate): void {
const icon = this.themeService.getTheme().type === LIGHT ? element.icon : element.iconDark; const icon = this.themeService.getColorTheme().type === LIGHT ? element.icon : element.iconDark;
const iconUri = icon ? URI.revive(icon) : null; const iconUri = icon ? URI.revive(icon) : null;
templateData.icon.style.backgroundImage = iconUri ? `url('${iconUri.toString(true)}')` : ''; templateData.icon.style.backgroundImage = iconUri ? `url('${iconUri.toString(true)}')` : '';
templateData.icon.style.backgroundRepeat = 'no-repeat'; templateData.icon.style.backgroundRepeat = 'no-repeat';
@@ -20,8 +20,8 @@ const languageAssociationRegistry = Registry.as<ILanguageAssociationRegistry>(La
*/ */
export async function setMode(accessor: ServicesAccessor, modeSupport: IModeSupport, activeEditor: IEditorInput, language: string): Promise<void> { export async function setMode(accessor: ServicesAccessor, modeSupport: IModeSupport, activeEditor: IEditorInput, language: string): Promise<void> {
const editorService = accessor.get(IEditorService); const editorService = accessor.get(IEditorService);
const activeWidget = getCodeEditor(editorService.activeTextEditorWidget); const activeWidget = getCodeEditor(editorService.activeTextEditorControl);
const activeControl = editorService.activeControl; const activeControl = editorService.activeEditorPane;
const textModel = activeWidget.getModel(); const textModel = activeWidget.getModel();
const oldLanguage = textModel.getLanguageIdentifier().language; const oldLanguage = textModel.getLanguageIdentifier().language;
if (language !== oldLanguage) { if (language !== oldLanguage) {
@@ -27,7 +27,7 @@ import { URI } from 'vs/base/common/uri';
import { dirname, basename } from 'vs/base/common/resources'; import { dirname, basename } from 'vs/base/common/resources';
import { LIGHT, FileThemeIcon, FolderThemeIcon, registerThemingParticipant, IThemeService } from 'vs/platform/theme/common/themeService'; import { LIGHT, FileThemeIcon, FolderThemeIcon, registerThemingParticipant, IThemeService } from 'vs/platform/theme/common/themeService';
import { FileKind } from 'vs/platform/files/common/files'; import { FileKind } from 'vs/platform/files/common/files';
import { WorkbenchAsyncDataTree, TreeResourceNavigator } from 'vs/platform/list/browser/listService'; import { WorkbenchAsyncDataTree, ResourceNavigator } from 'vs/platform/list/browser/listService';
import { localize } from 'vs/nls'; import { localize } from 'vs/nls';
import { timeout } from 'vs/base/common/async'; import { timeout } from 'vs/base/common/async';
import { editorFindMatchHighlight, editorFindMatchHighlightBorder, textLinkForeground, textCodeBlockBackground, focusBorder } from 'vs/platform/theme/common/colorRegistry'; import { editorFindMatchHighlight, editorFindMatchHighlightBorder, textLinkForeground, textCodeBlockBackground, focusBorder } from 'vs/platform/theme/common/colorRegistry';
@@ -52,7 +52,7 @@ import { firstIndex } from 'vs/base/common/arrays';
import { ViewPane, IViewPaneOptions } from 'vs/workbench/browser/parts/views/viewPaneContainer'; import { ViewPane, IViewPaneOptions } from 'vs/workbench/browser/parts/views/viewPaneContainer';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
export class CustomTreeViewPanel extends ViewPane { export class CustomTreeViewPane extends ViewPane {
private treeView: ITreeView; private treeView: ITreeView;
@@ -69,13 +69,14 @@ export class CustomTreeViewPanel extends ViewPane {
@IThemeService protected themeService: IThemeService, @IThemeService protected themeService: IThemeService,
@ITelemetryService telemetryService: ITelemetryService, @ITelemetryService telemetryService: ITelemetryService,
) { ) {
super({ ...(options as IViewPaneOptions), ariaHeaderLabel: options.title }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService); super({ ...(options as IViewPaneOptions) }, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService, telemetryService);
const { treeView } = (<ITreeViewDescriptor>Registry.as<IViewsRegistry>(Extensions.ViewsRegistry).getView(options.id)); const { treeView } = (<ITreeViewDescriptor>Registry.as<IViewsRegistry>(Extensions.ViewsRegistry).getView(options.id));
this.treeView = treeView as ITreeView; this.treeView = treeView as ITreeView;
this._register(this.treeView.onDidChangeActions(() => this.updateActions(), this)); this._register(this.treeView.onDidChangeActions(() => this.updateActions(), this));
this._register(this.treeView.onDidChangeTitle((newTitle) => this.updateTitle(newTitle))); this._register(this.treeView.onDidChangeTitle((newTitle) => this.updateTitle(newTitle)));
this._register(toDisposable(() => this.treeView.setVisibility(false))); this._register(toDisposable(() => this.treeView.setVisibility(false)));
this._register(this.onDidChangeBodyVisibility(() => this.updateTreeVisibility())); this._register(this.onDidChangeBodyVisibility(() => this.updateTreeVisibility()));
this._register(this.treeView.onDidChangeWelcomeState(() => this._onDidChangeViewWelcomeState.fire()));
this.updateTreeVisibility(); this.updateTreeVisibility();
} }
@@ -90,18 +91,14 @@ export class CustomTreeViewPanel extends ViewPane {
} }
} }
shouldShowWelcome(): boolean {
return (this.treeView.dataProvider === undefined) && (this.treeView.message === undefined);
}
layoutBody(height: number, width: number): void { layoutBody(height: number, width: number): void {
this.treeView.layout(height, width); this.treeView.layout(height, width);
} }
getActions(): IAction[] {
return [...this.treeView.getPrimaryActions()];
}
getSecondaryActions(): IAction[] {
return [...this.treeView.getSecondaryActions()];
}
getActionViewItem(action: IAction): IActionViewItem | undefined { getActionViewItem(action: IAction): IActionViewItem | undefined {
return action instanceof MenuItemAction ? new ContextAwareMenuEntryActionViewItem(action, this.keybindingService, this.notificationService, this.contextMenuService) : undefined; return action instanceof MenuItemAction ? new ContextAwareMenuEntryActionViewItem(action, this.keybindingService, this.notificationService, this.contextMenuService) : undefined;
} }
@@ -209,6 +206,9 @@ export class CustomTreeView extends Disposable implements ITreeView {
private readonly _onDidChangeActions: Emitter<void> = this._register(new Emitter<void>()); private readonly _onDidChangeActions: Emitter<void> = this._register(new Emitter<void>());
readonly onDidChangeActions: Event<void> = this._onDidChangeActions.event; readonly onDidChangeActions: Event<void> = this._onDidChangeActions.event;
private readonly _onDidChangeWelcomeState: Emitter<void> = this._register(new Emitter<void>());
readonly onDidChangeWelcomeState: Event<void> = this._onDidChangeWelcomeState.event;
private readonly _onDidChangeTitle: Emitter<string> = this._register(new Emitter<string>()); private readonly _onDidChangeTitle: Emitter<string> = this._register(new Emitter<string>());
readonly onDidChangeTitle: Event<string> = this._onDidChangeTitle.event; readonly onDidChangeTitle: Event<string> = this._onDidChangeTitle.event;
@@ -232,7 +232,7 @@ export class CustomTreeView extends Disposable implements ITreeView {
this.menus = this._register(instantiationService.createInstance(TitleMenus, this.id)); this.menus = this._register(instantiationService.createInstance(TitleMenus, this.id));
this._register(this.menus.onDidChangeTitle(() => this._onDidChangeActions.fire())); this._register(this.menus.onDidChangeTitle(() => this._onDidChangeActions.fire()));
this._register(this.themeService.onDidFileIconThemeChange(() => this.doRefresh([this.root]) /** soft refresh **/)); this._register(this.themeService.onDidFileIconThemeChange(() => this.doRefresh([this.root]) /** soft refresh **/));
this._register(this.themeService.onThemeChange(() => this.doRefresh([this.root]) /** soft refresh **/)); this._register(this.themeService.onDidColorThemeChange(() => this.doRefresh([this.root]) /** soft refresh **/));
this._register(this.configurationService.onDidChangeConfiguration(e => { this._register(this.configurationService.onDidChangeConfiguration(e => {
if (e.affectsConfiguration('explorer.decorations')) { if (e.affectsConfiguration('explorer.decorations')) {
this.doRefresh([this.root]).catch(onUnexpectedError); /** soft refresh **/ this.doRefresh([this.root]).catch(onUnexpectedError); /** soft refresh **/
@@ -277,6 +277,8 @@ export class CustomTreeView extends Disposable implements ITreeView {
this._dataProvider = null; this._dataProvider = null;
this.updateMessage(); this.updateMessage();
} }
this._onDidChangeWelcomeState.fire();
} }
private _message: string | undefined; private _message: string | undefined;
@@ -287,6 +289,7 @@ export class CustomTreeView extends Disposable implements ITreeView {
set message(message: string | undefined) { set message(message: string | undefined) {
this._message = message; this._message = message;
this.updateMessage(); this.updateMessage();
this._onDidChangeWelcomeState.fire();
} }
get title(): string { get title(): string {
@@ -448,7 +451,7 @@ export class CustomTreeView extends Disposable implements ITreeView {
})); }));
this.tree.setInput(this.root).then(() => this.updateContentAreas()); this.tree.setInput(this.root).then(() => this.updateContentAreas());
const customTreeNavigator = new TreeResourceNavigator(this.tree); const customTreeNavigator = ResourceNavigator.createTreeResourceNavigator(this.tree, { openOnFocus: false, openOnSelection: false });
this._register(customTreeNavigator); this._register(customTreeNavigator);
this._register(customTreeNavigator.onDidOpenResource(e => { this._register(customTreeNavigator.onDidOpenResource(e => {
if (!e.browserEvent) { if (!e.browserEvent) {
@@ -809,7 +812,7 @@ class TreeRenderer extends Disposable implements ITreeRenderer<ITreeItem, FuzzyS
const treeItemLabel: ITreeItemLabel | undefined = node.label ? node.label : resource ? { label: basename(resource) } : undefined; const treeItemLabel: ITreeItemLabel | undefined = node.label ? node.label : resource ? { label: basename(resource) } : undefined;
const description = isString(node.description) ? node.description : resource && node.description === true ? this.labelService.getUriLabel(dirname(resource), { relative: true }) : undefined; const description = isString(node.description) ? node.description : resource && node.description === true ? this.labelService.getUriLabel(dirname(resource), { relative: true }) : undefined;
const label = treeItemLabel ? treeItemLabel.label : undefined; const label = treeItemLabel ? treeItemLabel.label : undefined;
const icon = this.themeService.getTheme().type === LIGHT ? node.icon : node.iconDark; const icon = this.themeService.getColorTheme().type === LIGHT ? node.icon : node.iconDark;
const iconUrl = icon ? URI.revive(icon) : null; const iconUrl = icon ? URI.revive(icon) : null;
const title = node.tooltip ? node.tooltip : resource ? undefined : label; const title = node.tooltip ? node.tooltip : resource ? undefined : label;
const sqlIcon = node.sqlIcon; const sqlIcon = node.sqlIcon;
@@ -892,7 +895,7 @@ class Aligner extends Disposable {
} }
private hasIcon(node: ITreeItem): boolean { private hasIcon(node: ITreeItem): boolean {
const icon = this.themeService.getTheme().type === LIGHT ? node.icon : node.iconDark; const icon = this.themeService.getColorTheme().type === LIGHT ? node.icon : node.iconDark;
if (icon) { if (icon) {
return true; return true;
} }
@@ -172,7 +172,7 @@ export abstract class QueryEditorInput extends EditorInput implements IConnectab
// Description is shown beside the tab name in the combobox of open editors // Description is shown beside the tab name in the combobox of open editors
public getDescription(): string { return this._description; } public getDescription(): string { return this._description; }
public supportsSplitEditor(): boolean { return false; } public supportsSplitEditor(): boolean { return false; }
public revert(group: GroupIdentifier, options?: IRevertOptions): Promise<boolean> { public revert(group: GroupIdentifier, options?: IRevertOptions): Promise<void> {
return this._text.revert(group, options); return this._text.revert(group, options);
} }
@@ -30,10 +30,10 @@ import { IContextViewService } from 'vs/platform/contextview/browser/contextView
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
import { ISelectOptionItem } from 'vs/base/browser/ui/selectBox/selectBox'; import { ISelectOptionItem } from 'vs/base/browser/ui/selectBox/selectBox';
import { KeyCode } from 'vs/base/common/keyCodes'; import { KeyCode } from 'vs/base/common/keyCodes';
import { ITheme } from 'vs/platform/theme/common/themeService';
import { AngularDisposable } from 'sql/base/browser/lifecycle'; import { AngularDisposable } from 'sql/base/browser/lifecycle';
import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme'; import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
import { fileFiltersSet } from 'sql/workbench/services/restore/common/constants'; import { fileFiltersSet } from 'sql/workbench/services/restore/common/constants';
import { IColorTheme } from 'vs/platform/theme/common/themeService';
export const BACKUP_SELECTOR: string = 'backup-component'; export const BACKUP_SELECTOR: string = 'backup-component';
@@ -349,7 +349,7 @@ export class BackupComponent extends AngularDisposable {
this.mediaDescriptionBox.disable(); this.mediaDescriptionBox.disable();
this.registerListeners(); this.registerListeners();
this.updateTheme(this.themeService.getTheme()); this.updateTheme(this.themeService.getColorTheme());
} }
ngAfterViewInit() { ngAfterViewInit() {
@@ -552,7 +552,7 @@ export class BackupComponent extends AngularDisposable {
} }
// Update theming that is specific to backup dialog // Update theming that is specific to backup dialog
private updateTheme(theme: ITheme): void { private updateTheme(theme: IColorTheme): void {
// set modal footer style // set modal footer style
let footerHtmlElement: HTMLElement = <HTMLElement>this.modalFooterElement.nativeElement; let footerHtmlElement: HTMLElement = <HTMLElement>this.modalFooterElement.nativeElement;
const backgroundColor = theme.getColor(SIDE_BAR_BACKGROUND); const backgroundColor = theme.getColor(SIDE_BAR_BACKGROUND);
@@ -16,10 +16,10 @@ import { bootstrapAngular } from 'sql/workbench/services/bootstrap/browser/boots
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService'; import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
import { append, $ } from 'vs/base/browser/dom'; import { append, $ } from 'vs/base/browser/dom';
import { ILogService } from 'vs/platform/log/common/log'; import { ILogService } from 'vs/platform/log/common/log';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfigurationService'; import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfigurationService';
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry'; import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
import { attachModalDialogStyler } from 'sql/workbench/common/styler'; import { attachModalDialogStyler } from 'sql/workbench/common/styler';
import { ILayoutService } from 'vs/platform/layout/browser/layoutService';
export class BackupDialog extends Modal { export class BackupDialog extends Modal {
private _body: HTMLElement; private _body: HTMLElement;
@@ -28,7 +28,7 @@ export class BackupDialog extends Modal {
constructor( constructor(
@IThemeService themeService: IThemeService, @IThemeService themeService: IThemeService,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService, @ILayoutService layoutService: ILayoutService,
@IAdsTelemetryService telemetryService: IAdsTelemetryService, @IAdsTelemetryService telemetryService: IAdsTelemetryService,
@IContextKeyService contextKeyService: IContextKeyService, @IContextKeyService contextKeyService: IContextKeyService,
@IInstantiationService private _instantiationService: IInstantiationService, @IInstantiationService private _instantiationService: IInstantiationService,
@@ -9,7 +9,7 @@ import { mixin } from 'sql/base/common/objects';
import { localize } from 'vs/nls'; import { localize } from 'vs/nls';
import * as colors from 'vs/platform/theme/common/colorRegistry'; import * as colors from 'vs/platform/theme/common/colorRegistry';
import { editorLineNumbers } from 'vs/editor/common/view/editorColorRegistry'; import { editorLineNumbers } from 'vs/editor/common/view/editorColorRegistry';
import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService'; import { IThemeService, IColorTheme } from 'vs/platform/theme/common/themeService';
import { IInsight, IPointDataSet, customMixin } from './interfaces'; import { IInsight, IPointDataSet, customMixin } from './interfaces';
import { IInsightOptions, DataDirection, ChartType, LegendPosition, DataType } from 'sql/workbench/contrib/charts/common/interfaces'; import { IInsightOptions, DataDirection, ChartType, LegendPosition, DataType } from 'sql/workbench/contrib/charts/common/interfaces';
@@ -53,14 +53,14 @@ export class Graph implements IInsight {
public static readonly types = [ChartType.Bar, ChartType.Doughnut, ChartType.HorizontalBar, ChartType.Line, ChartType.Pie, ChartType.Scatter, ChartType.TimeSeries]; public static readonly types = [ChartType.Bar, ChartType.Doughnut, ChartType.HorizontalBar, ChartType.Line, ChartType.Pie, ChartType.Scatter, ChartType.TimeSeries];
public readonly types = Graph.types; public readonly types = Graph.types;
private _theme: ITheme; private _theme: IColorTheme;
constructor( constructor(
container: HTMLElement, options: IInsightOptions = defaultOptions, container: HTMLElement, options: IInsightOptions = defaultOptions,
@IThemeService themeService: IThemeService @IThemeService themeService: IThemeService
) { ) {
this._theme = themeService.getTheme(); this._theme = themeService.getColorTheme();
themeService.onThemeChange(e => { themeService.onDidColorThemeChange(e => {
this._theme = e; this._theme = e;
this.data = this._data; this.data = this._data;
}); });
@@ -26,7 +26,7 @@ import { WebviewWidget } from 'sql/workbench/contrib/dashboard/browser/widgets/w
import { CommonServiceInterface } from 'sql/workbench/services/bootstrap/browser/commonServiceInterface.service'; import { CommonServiceInterface } from 'sql/workbench/services/bootstrap/browser/commonServiceInterface.service';
import { IColorTheme, IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService'; import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import * as colors from 'vs/platform/theme/common/colorRegistry'; import * as colors from 'vs/platform/theme/common/colorRegistry';
import * as themeColors from 'vs/workbench/common/theme'; import * as themeColors from 'vs/workbench/common/theme';
import { Action, IAction } from 'vs/base/common/actions'; import { Action, IAction } from 'vs/base/common/actions';
@@ -37,6 +37,7 @@ import { generateUuid } from 'vs/base/common/uuid';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { ILogService } from 'vs/platform/log/common/log'; import { ILogService } from 'vs/platform/log/common/log';
import { values } from 'vs/base/common/collections'; import { values } from 'vs/base/common/collections';
import { IColorTheme } from 'vs/platform/theme/common/themeService';
const componentMap: { [x: string]: Type<IDashboardWidget> } = { const componentMap: { [x: string]: Type<IDashboardWidget> } = {
'properties-widget': PropertiesWidgetComponent, 'properties-widget': PropertiesWidgetComponent,
@@ -98,7 +98,7 @@ export class WebviewContent extends AngularDisposable implements OnInit, IDashbo
this._onMessageDisposable.dispose(); this._onMessageDisposable.dispose();
} }
this._webview = this.webviewService.createWebview(this.id, this._webview = this.webviewService.createWebviewElement(this.id,
{}, {},
{ {
allowScripts: true allowScripts: true
@@ -5,14 +5,14 @@
import 'vs/css!./dashboardPanel'; import 'vs/css!./dashboardPanel';
import { registerThemingParticipant, ITheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService'; import { registerThemingParticipant, IColorTheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService';
import { import {
TAB_ACTIVE_BACKGROUND, TAB_ACTIVE_FOREGROUND, TAB_ACTIVE_BORDER, TAB_INACTIVE_BACKGROUND, TAB_ACTIVE_BACKGROUND, TAB_ACTIVE_FOREGROUND, TAB_ACTIVE_BORDER, TAB_INACTIVE_BACKGROUND,
TAB_INACTIVE_FOREGROUND, EDITOR_GROUP_HEADER_TABS_BACKGROUND, TAB_BORDER, EDITOR_GROUP_BORDER TAB_INACTIVE_FOREGROUND, EDITOR_GROUP_HEADER_TABS_BACKGROUND, TAB_BORDER, EDITOR_GROUP_BORDER
} from 'vs/workbench/common/theme'; } from 'vs/workbench/common/theme';
import { activeContrastBorder } from 'vs/platform/theme/common/colorRegistry'; import { activeContrastBorder } from 'vs/platform/theme/common/colorRegistry';
registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => { registerThemingParticipant((theme: IColorTheme, collector: ICssStyleCollector) => {
// Title Active // Title Active
const tabActiveBackground = theme.getColor(TAB_ACTIVE_BACKGROUND); const tabActiveBackground = theme.getColor(TAB_ACTIVE_BACKGROUND);
@@ -112,4 +112,4 @@ registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => {
} }
`); `);
} }
}); });
@@ -15,10 +15,11 @@ import { RefreshWidgetAction, EditDashboardAction } from 'sql/workbench/contrib/
import { DashboardPage } from 'sql/workbench/contrib/dashboard/browser/core/dashboardPage.component'; import { DashboardPage } from 'sql/workbench/contrib/dashboard/browser/core/dashboardPage.component';
import { AngularDisposable } from 'sql/base/browser/lifecycle'; import { AngularDisposable } from 'sql/base/browser/lifecycle';
import { IColorTheme, IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService'; import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
import { IDisposable } from 'vs/base/common/lifecycle'; import { IDisposable } from 'vs/base/common/lifecycle';
import * as themeColors from 'vs/workbench/common/theme'; import * as themeColors from 'vs/workbench/common/theme';
import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
import { IColorTheme } from 'vs/platform/theme/common/themeService';
import { onUnexpectedError } from 'vs/base/common/errors'; import { onUnexpectedError } from 'vs/base/common/errors';
export const DASHBOARD_SELECTOR: string = 'dashboard-component'; export const DASHBOARD_SELECTOR: string = 'dashboard-component';
@@ -15,7 +15,7 @@ import * as colors from 'vs/platform/theme/common/colorRegistry';
import * as types from 'vs/base/common/types'; import * as types from 'vs/base/common/types';
import { Disposable } from 'vs/base/common/lifecycle'; import { Disposable } from 'vs/base/common/lifecycle';
import * as nls from 'vs/nls'; import * as nls from 'vs/nls';
import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService'; import { IThemeService, IColorTheme } from 'vs/platform/theme/common/themeService';
import { IPointDataSet } from 'sql/workbench/contrib/charts/browser/interfaces'; import { IPointDataSet } from 'sql/workbench/contrib/charts/browser/interfaces';
import { IInsightsView, IInsightData } from 'sql/platform/dashboard/browser/insightRegistry'; import { IInsightsView, IInsightData } from 'sql/platform/dashboard/browser/insightRegistry';
import { ChartType, LegendPosition } from 'sql/workbench/contrib/charts/common/interfaces'; import { ChartType, LegendPosition } from 'sql/workbench/contrib/charts/common/interfaces';
@@ -61,8 +61,8 @@ export abstract class ChartInsight extends Disposable implements IInsightsView {
} }
init() { init() {
this._register(this.themeService.onThemeChange(e => this.updateTheme(e))); this._register(this.themeService.onDidColorThemeChange(e => this.updateTheme(e)));
this.updateTheme(this.themeService.getTheme()); this.updateTheme(this.themeService.getColorTheme());
// Note: must use a boolean to not render the canvas until all properties such as the labels and chart type are set. // Note: must use a boolean to not render the canvas until all properties such as the labels and chart type are set.
// This is because chart.js doesn't auto-update anything other than dataset when re-rendering so defaults are used // This is because chart.js doesn't auto-update anything other than dataset when re-rendering so defaults are used
// hence it's easier to not render until ready // hence it's easier to not render until ready
@@ -96,7 +96,7 @@ export abstract class ChartInsight extends Disposable implements IInsightsView {
return this._options; return this._options;
} }
protected updateTheme(e: ITheme): void { protected updateTheme(e: IColorTheme): void {
const foregroundColor = e.getColor(colors.editorForeground); const foregroundColor = e.getColor(colors.editorForeground);
const foreground = foregroundColor ? foregroundColor.toString() : null; const foreground = foregroundColor ? foregroundColor.toString() : null;
const backgroundColor = e.getColor(colors.editorBackground); const backgroundColor = e.getColor(colors.editorBackground);
@@ -10,7 +10,7 @@ import { IChartConfig } from 'sql/workbench/contrib/dashboard/browser/widgets/in
import * as colors from 'vs/platform/theme/common/colorRegistry'; import * as colors from 'vs/platform/theme/common/colorRegistry';
import { editorLineNumbers } from 'vs/editor/common/view/editorColorRegistry'; import { editorLineNumbers } from 'vs/editor/common/view/editorColorRegistry';
import { ChangeDetectorRef, Inject, forwardRef } from '@angular/core'; import { ChangeDetectorRef, Inject, forwardRef } from '@angular/core';
import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService'; import { IThemeService, IColorTheme } from 'vs/platform/theme/common/themeService';
import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry'; import { IAdsTelemetryService } from 'sql/platform/telemetry/common/telemetry';
import { customMixin } from 'sql/workbench/contrib/charts/browser/interfaces'; import { customMixin } from 'sql/workbench/contrib/charts/browser/interfaces';
import { ChartType } from 'sql/workbench/contrib/charts/common/interfaces'; import { ChartType } from 'sql/workbench/contrib/charts/common/interfaces';
@@ -127,7 +127,7 @@ export default class BarChart extends ChartInsight {
super.setConfig(config); super.setConfig(config);
} }
protected updateTheme(e: ITheme): void { protected updateTheme(e: IColorTheme): void {
super.updateTheme(e); super.updateTheme(e);
const foregroundColor = e.getColor(colors.editorForeground); const foregroundColor = e.getColor(colors.editorForeground);
const foreground = foregroundColor ? foregroundColor.toString() : null; const foreground = foregroundColor ? foregroundColor.toString() : null;

Some files were not shown because too many files have changed in this diff Show More