Merge from vscode c58aaab8a1cc22a7139b761166a0d4f37d41e998 (#7880)

* Merge from vscode c58aaab8a1cc22a7139b761166a0d4f37d41e998

* fix pipelines

* fix strict-null-checks

* add missing files
This commit is contained in:
Anthony Dresser
2019-10-21 22:12:22 -07:00
committed by GitHub
parent 7c9be74970
commit 1e22f47304
913 changed files with 18898 additions and 16536 deletions

9
.github/pull_request_template.md vendored Normal file
View File

@@ -0,0 +1,9 @@
<!-- Thank you for submitting a Pull Request. Please:
* Read our Pull Request guidelines:
https://github.com/Microsoft/vscode/wiki/How-to-Contribute#pull-requests.
* Associate an issue with the Pull Request.
* Ensure that the code is up-to-date with the `master` branch.
* Include a description of the proposed changes and how to test them.
-->
This PR fixes #

27
.vscode/launch.json vendored
View File

@@ -128,6 +128,33 @@
"webRoot": "${workspaceFolder}",
"timeout": 45000
},
{
"type": "chrome",
"request": "launch",
"name": "Launch ADS (Web) (TBD)",
"runtimeExecutable": "yarn",
"runtimeArgs": [
"web"
],
},
{
"type": "chrome",
"request": "launch",
"name": "Launch ADS (Web, Chrome) (TBD)",
"url": "http://localhost:8080",
"preLaunchTask": "Run web"
},
{
"type": "node",
"request": "launch",
"name": "Git Unit Tests",
"program": "${workspaceFolder}/extensions/git/node_modules/mocha/bin/_mocha",
"stopOnEntry": false,
"cwd": "${workspaceFolder}/extensions/git",
"outFiles": [
"${workspaceFolder}/extensions/git/out/**/*.js"
]
},
{
"name": "Launch Built-in Extension",
"type": "extensionHost",

View File

@@ -60,5 +60,6 @@
"remote.extensionKind": {
"msjsdiag.debugger-for-chrome": "workspace"
},
"gulp.autoDetect": "off",
"files.insertFinalNewline": true
}

23
.vscode/tasks.json vendored
View File

@@ -90,8 +90,8 @@
"problemMatcher": []
},
{
"type": "gulp",
"task": "electron",
"type": "npm",
"script": "electron",
"label": "Download electron"
},
{
@@ -99,5 +99,24 @@
"task": "hygiene",
"problemMatcher": []
},
{
"type": "shell",
"command": "yarn web -- --no-launch",
"label": "Run web",
"isBackground": true,
// This section to make error go away when launching the debug config
"problemMatcher": {
"pattern": {
"regexp": ""
},
"background": {
"beginsPattern": ".*node .*",
"endsPattern": "Web UI available at .*"
}
},
"presentation": {
"reveal": "never"
}
},
]
}

View File

@@ -1,3 +1,3 @@
disturl "https://atom.io/download/electron"
target "4.2.10"
target "6.0.12"
runtime "electron"

View File

@@ -40,7 +40,7 @@ steps:
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
- script: |
yarn gulp electron-x64
yarn electron x64
displayName: Download Electron
env:
GITHUB_TOKEN: $(GITHUB_TOKEN)

View File

@@ -28,7 +28,7 @@ steps:
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
- script: |
yarn gulp electron-x64
yarn electron x64
displayName: "Electron"
env:
GITHUB_TOKEN: $(GITHUB_TOKEN)

View File

@@ -21,7 +21,7 @@ steps:
vstsFeed: '$(ArtifactFeed)'
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
- script: |
yarn gulp electron-x64
yarn electron x64
displayName: Download Electron
- script: |
yarn gulp hygiene --skip-tslint

View File

@@ -29,7 +29,7 @@ steps:
vstsFeed: '$(ArtifactFeed)'
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
- script: |
yarn gulp electron-x64
yarn electron x64
displayName: Download Electron
- script: |
yarn gulp hygiene --skip-tslint

View File

@@ -25,7 +25,7 @@ steps:
vstsFeed: '$(ArtifactFeed)'
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
- powershell: |
yarn gulp electron
yarn electron
- script: |
yarn gulp hygiene --skip-tslint
displayName: Run Hygiene Checks

View File

@@ -107,7 +107,7 @@ steps:
- powershell: |
. build/azure-pipelines/win32/exec.ps1
$ErrorActionPreference = "Stop"
exec { yarn gulp "electron-$(VSCODE_ARCH)" }
exec { yarn electron $(VSCODE_ARCH) }
exec { .\scripts\test.bat --build --tfs "Unit Tests" }
displayName: Run unit tests
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))

View File

@@ -84,9 +84,6 @@ const extractEditorSrcTask = task.define('extract-editor-src', () => {
`lib.dom.d.ts`,
`lib.webworker.importscripts.d.ts`
],
redirects: {
'vs/base/browser/ui/octiconLabel/octiconLabel': 'vs/base/browser/ui/octiconLabel/octiconLabel.mock',
},
shakeLevel: 2, // 0-Files, 1-InnerFile, 2-ClassMembers
importIgnorePattern: /(^vs\/css!)|(promise-polyfill\/polyfill)/,
destRoot: path.join(root, 'out-editor-src')

View File

@@ -73,7 +73,6 @@ const indentationFilter = [
'!**/yarn-error.log',
// except multiple specific folders
'!**/octicons/**',
'!**/codicon/**',
'!**/fixtures/**',
'!**/lib/**',
@@ -136,6 +135,7 @@ const copyrightFilter = [
'!extensions/html-language-features/server/src/modes/typescript/*',
'!extensions/*/server/bin/*',
'!src/vs/editor/test/node/classification/typescript-test.ts',
'!scripts/code-web.js',
// {{SQL CARBON EDIT}}
'!extensions/notebook/src/intellisense/text.ts',
'!extensions/mssql/src/hdfs/webhdfs.ts',

View File

@@ -31,7 +31,7 @@ const crypto = require('crypto');
const i18n = require('./lib/i18n');
const ext = require('./lib/extensions'); // {{SQL CARBON EDIT}}
const deps = require('./dependencies');
const getElectronVersion = require('./lib/electron').getElectronVersion;
const { config } = require('./lib/electron');
const createAsar = require('./lib/asar').createAsar;
const { compileBuildTask } = require('./gulpfile.compile');
const { compileExtensionsBuildTask } = require('./gulpfile.extensions');
@@ -78,7 +78,6 @@ const vscodeResources = [
'out-build/vs/base/common/performance.js',
'out-build/vs/base/node/languagePacks.js',
'out-build/vs/base/node/{stdForkStart.js,terminateProcess.sh,cpuUsage.sh,ps.sh}',
'out-build/vs/base/browser/ui/octiconLabel/octicons/**',
'out-build/vs/base/browser/ui/codiconLabel/codicon/**',
'out-build/vs/workbench/browser/media/*-theme.css',
'out-build/vs/workbench/contrib/debug/**/*.json',
@@ -144,72 +143,6 @@ const minifyVSCodeTask = task.define('minify-vscode', task.series(
));
gulp.task(minifyVSCodeTask);
// Package
// @ts-ignore JSON checking: darwinCredits is optional
const darwinCreditsTemplate = product.darwinCredits && _.template(fs.readFileSync(path.join(root, product.darwinCredits), 'utf8'));
function darwinBundleDocumentType(extensions, icon) {
return {
name: product.nameLong + ' document',
role: 'Editor',
ostypes: ["TEXT", "utxt", "TUTX", "****"],
extensions: extensions,
iconFile: icon
};
}
const config = {
version: getElectronVersion(),
productAppName: product.nameLong,
companyName: 'Microsoft Corporation',
copyright: 'Copyright (C) 2019 Microsoft. All rights reserved',
darwinIcon: product.quality === 'stable' ? 'resources/darwin/code.icns' : 'resources/darwin/code-insiders.icns', // {{SQL CARBON EDIT}} Use separate icons for non-stable
darwinBundleIdentifier: product.darwinBundleIdentifier,
darwinApplicationCategoryType: 'public.app-category.developer-tools',
darwinHelpBookFolder: 'VS Code HelpBook',
darwinHelpBookName: 'VS Code HelpBook',
darwinBundleDocumentTypes: [
darwinBundleDocumentType(["csv", "json", "sqlplan", "sql", "xml"], product.quality === 'stable' ? 'resources/darwin/code_file.icns' : 'resources/darwin/code_file-insiders.icns'), // {{SQL CARBON EDIT}} - Remove most document types and replace with ours. Also use separate icon for non-stable
],
darwinBundleURLTypes: [{
role: 'Viewer',
name: product.nameLong,
urlSchemes: [product.urlProtocol]
}],
darwinForceDarkModeSupport: true,
darwinCredits: darwinCreditsTemplate ? Buffer.from(darwinCreditsTemplate({ commit: commit, date: new Date().toISOString() })) : undefined,
linuxExecutableName: product.applicationName,
winIcon: product.quality === 'stable' ? 'resources/win32/code.ico' : 'resources/win32/code-insiders.ico', // {{SQL CARBON EDIT}} Use separate icons for non-stable
token: process.env['VSCODE_MIXIN_PASSWORD'] || process.env['GITHUB_TOKEN'] || undefined,
// @ts-ignore JSON checking: electronRepository is optional
repo: product.electronRepository || undefined
};
function getElectron(arch) {
return () => {
const electronOpts = _.extend({}, config, {
platform: process.platform,
arch,
ffmpegChromium: true,
keepDefaultApp: true
});
return gulp.src('package.json')
.pipe(json({ name: product.nameShort }))
.pipe(electron(electronOpts))
.pipe(filter(['**', '!**/app/package.json']))
.pipe(vfs.dest('.build/electron'));
};
}
gulp.task(task.define('electron', task.series(util.rimraf('.build/electron'), getElectron(process.arch))));
gulp.task(task.define('electron-ia32', task.series(util.rimraf('.build/electron'), getElectron('ia32'))));
gulp.task(task.define('electron-x64', task.series(util.rimraf('.build/electron'), getElectron('x64'))));
gulp.task(task.define('electron-arm', task.series(util.rimraf('.build/electron'), getElectron('armv7l'))));
gulp.task(task.define('electron-arm64', task.series(util.rimraf('.build/electron'), getElectron('arm64'))));
/**
* Compute checksums for some files.
*

View File

@@ -44,7 +44,7 @@ function prepareDebPackage(arch) {
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
.pipe(replace('@@NAME@@', product.applicationName))
.pipe(replace('@@EXEC@@', `/usr/share/${product.applicationName}/${product.applicationName}`))
.pipe(replace('@@ICON@@', product.linuxIconName))
.pipe(replace('@@ICON@@', `/usr/share/pixmaps/${product.linuxIconName}.png`))
.pipe(replace('@@URLPROTOCOL@@', product.urlProtocol));
const appdata = gulp.src('resources/linux/code.appdata.xml', { base: '.' })

View File

@@ -2,29 +2,88 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
const fs = require('fs');
const path = require('path');
Object.defineProperty(exports, "__esModule", { value: true });
const fs = require("fs");
const path = require("path");
const vfs = require("vinyl-fs");
const filter = require("gulp-filter");
const json = require("gulp-json-editor");
const _ = require("underscore");
const util = require("./util");
const electron = require('gulp-atom-electron');
const root = path.dirname(path.dirname(__dirname));
const product = JSON.parse(fs.readFileSync(path.join(root, 'product.json'), 'utf8'));
const commit = util.getVersion(root);
function getElectronVersion() {
const yarnrc = fs.readFileSync(path.join(root, '.yarnrc'), 'utf8');
// @ts-ignore
const target = /^target "(.*)"$/m.exec(yarnrc)[1];
return target;
}
module.exports.getElectronVersion = getElectronVersion;
// returns 0 if the right version of electron is in .build/electron
// @ts-ignore
if (require.main === module) {
const version = getElectronVersion();
const versionFile = path.join(root, '.build', 'electron', 'version');
const isUpToDate = fs.existsSync(versionFile) && fs.readFileSync(versionFile, 'utf8') === `${version}`;
process.exit(isUpToDate ? 0 : 1);
exports.getElectronVersion = getElectronVersion;
const darwinCreditsTemplate = product.darwinCredits && _.template(fs.readFileSync(path.join(root, product.darwinCredits), 'utf8'));
function darwinBundleDocumentType(extensions, icon) {
return {
name: product.nameLong + ' document',
role: 'Editor',
ostypes: ["TEXT", "utxt", "TUTX", "****"],
extensions: extensions,
iconFile: icon
};
}
exports.config = {
version: getElectronVersion(),
productAppName: product.nameLong,
companyName: 'Microsoft Corporation',
copyright: 'Copyright (C) 2019 Microsoft. All rights reserved',
darwinIcon: product.quality === 'stable' ? 'resources/darwin/code.icns' : 'resources/darwin/code-insiders.icns',
darwinBundleIdentifier: product.darwinBundleIdentifier,
darwinApplicationCategoryType: 'public.app-category.developer-tools',
darwinHelpBookFolder: 'VS Code HelpBook',
darwinHelpBookName: 'VS Code HelpBook',
darwinBundleDocumentTypes: [
darwinBundleDocumentType(["csv", "json", "sqlplan", "sql", "xml"], product.quality === 'stable' ? 'resources/darwin/code_file.icns' : 'resources/darwin/code_file-insiders.icns'),
],
darwinBundleURLTypes: [{
role: 'Viewer',
name: product.nameLong,
urlSchemes: [product.urlProtocol]
}],
darwinForceDarkModeSupport: true,
darwinCredits: darwinCreditsTemplate ? Buffer.from(darwinCreditsTemplate({ commit: commit, date: new Date().toISOString() })) : undefined,
linuxExecutableName: product.applicationName,
winIcon: product.quality === 'stable' ? 'resources/win32/code.ico' : 'resources/win32/code-insiders.ico',
token: process.env['VSCODE_MIXIN_PASSWORD'] || process.env['GITHUB_TOKEN'] || undefined,
repo: product.electronRepository || undefined
};
function getElectron(arch) {
return () => {
const electronOpts = _.extend({}, exports.config, {
platform: process.platform,
arch,
ffmpegChromium: true,
keepDefaultApp: true
});
return vfs.src('package.json')
.pipe(json({ name: product.nameShort }))
.pipe(electron(electronOpts))
.pipe(filter(['**', '!**/app/package.json']))
.pipe(vfs.dest('.build/electron'));
};
}
async function main(arch = process.arch) {
const version = getElectronVersion();
const electronPath = path.join(root, '.build', 'electron');
const versionFile = path.join(electronPath, 'version');
const isUpToDate = fs.existsSync(versionFile) && fs.readFileSync(versionFile, 'utf8') === `${version}`;
if (!isUpToDate) {
await util.rimraf(electronPath)();
await util.streamToPromise(getElectron(arch)());
}
}
if (require.main === module) {
main(process.argv[2]).catch(err => {
console.error(err);
process.exit(1);
});
}

100
build/lib/electron.ts Normal file
View File

@@ -0,0 +1,100 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as fs from 'fs';
import * as path from 'path';
import * as vfs from 'vinyl-fs';
import * as filter from 'gulp-filter';
import * as json from 'gulp-json-editor';
import * as _ from 'underscore';
import * as util from './util';
const electron = require('gulp-atom-electron');
const root = path.dirname(path.dirname(__dirname));
const product = JSON.parse(fs.readFileSync(path.join(root, 'product.json'), 'utf8'));
const commit = util.getVersion(root);
export function getElectronVersion(): string {
const yarnrc = fs.readFileSync(path.join(root, '.yarnrc'), 'utf8');
const target = /^target "(.*)"$/m.exec(yarnrc)![1];
return target;
}
const darwinCreditsTemplate = product.darwinCredits && _.template(fs.readFileSync(path.join(root, product.darwinCredits), 'utf8'));
function darwinBundleDocumentType(extensions: string[], icon: string) {
return {
name: product.nameLong + ' document',
role: 'Editor',
ostypes: ["TEXT", "utxt", "TUTX", "****"],
extensions: extensions,
iconFile: icon
};
}
export const config = {
version: getElectronVersion(),
productAppName: product.nameLong,
companyName: 'Microsoft Corporation',
copyright: 'Copyright (C) 2019 Microsoft. All rights reserved',
darwinIcon: product.quality === 'stable' ? 'resources/darwin/code.icns' : 'resources/darwin/code-insiders.icns', // {{SQL CARBON EDIT}} Use separate icons for non-stable
darwinBundleIdentifier: product.darwinBundleIdentifier,
darwinApplicationCategoryType: 'public.app-category.developer-tools',
darwinHelpBookFolder: 'VS Code HelpBook',
darwinHelpBookName: 'VS Code HelpBook',
darwinBundleDocumentTypes: [
darwinBundleDocumentType(["csv", "json", "sqlplan", "sql", "xml"], product.quality === 'stable' ? 'resources/darwin/code_file.icns' : 'resources/darwin/code_file-insiders.icns'), // {{SQL CARBON EDIT}} - Remove most document types and replace with ours. Also use separate icon for non-stable
],
darwinBundleURLTypes: [{
role: 'Viewer',
name: product.nameLong,
urlSchemes: [product.urlProtocol]
}],
darwinForceDarkModeSupport: true,
darwinCredits: darwinCreditsTemplate ? Buffer.from(darwinCreditsTemplate({ commit: commit, date: new Date().toISOString() })) : undefined,
linuxExecutableName: product.applicationName,
winIcon: product.quality === 'stable' ? 'resources/win32/code.ico' : 'resources/win32/code-insiders.ico', // {{SQL CARBON EDIT}} Use separate icons for non-stable
token: process.env['VSCODE_MIXIN_PASSWORD'] || process.env['GITHUB_TOKEN'] || undefined,
repo: product.electronRepository || undefined
};
function getElectron(arch: string): () => NodeJS.ReadWriteStream {
return () => {
const electronOpts = _.extend({}, config, {
platform: process.platform,
arch,
ffmpegChromium: true,
keepDefaultApp: true
});
return vfs.src('package.json')
.pipe(json({ name: product.nameShort }))
.pipe(electron(electronOpts))
.pipe(filter(['**', '!**/app/package.json']))
.pipe(vfs.dest('.build/electron'));
};
}
async function main(arch = process.arch): Promise<void> {
const version = getElectronVersion();
const electronPath = path.join(root, '.build', 'electron');
const versionFile = path.join(electronPath, 'version');
const isUpToDate = fs.existsSync(versionFile) && fs.readFileSync(versionFile, 'utf8') === `${version}`;
if (!isUpToDate) {
await util.rimraf(electronPath)();
await util.streamToPromise(getElectron(arch)());
}
}
if (require.main === module) {
main(process.argv[2]).catch(err => {
console.error(err);
process.exit(1);
});
}

View File

@@ -166,20 +166,23 @@ function stripSourceMappingURL() {
}
exports.stripSourceMappingURL = stripSourceMappingURL;
function rimraf(dir) {
const result = () => new Promise((c, e) => {
let retries = 0;
const retry = (cb) => {
const retry = () => {
_rimraf(dir, { maxBusyTries: 1 }, (err) => {
if (!err) {
return cb();
return c();
}
if (err.code === 'ENOTEMPTY' && ++retries < 5) {
return setTimeout(() => retry(cb), 10);
return setTimeout(() => retry(), 10);
}
return cb(err);
return e(err);
});
};
retry.taskName = `clean-${path.basename(dir).toLowerCase()}`;
return retry;
retry();
});
result.taskName = `clean-${path.basename(dir).toLowerCase()}`;
return result;
}
exports.rimraf = rimraf;
function getVersion(root) {
@@ -219,3 +222,10 @@ function versionStringToNumber(versionStr) {
return parseInt(match[1], 10) * 1e4 + parseInt(match[2], 10) * 1e2 + parseInt(match[3], 10);
}
exports.versionStringToNumber = versionStringToNumber;
function streamToPromise(stream) {
return new Promise((c, e) => {
stream.on('error', err => e(err));
stream.on('end', () => c());
});
}
exports.streamToPromise = streamToPromise;

View File

@@ -218,24 +218,29 @@ export function stripSourceMappingURL(): NodeJS.ReadWriteStream {
return es.duplex(input, output);
}
export function rimraf(dir: string): (cb: any) => void {
export function rimraf(dir: string): () => Promise<void> {
const result = () => new Promise<void>((c, e) => {
let retries = 0;
const retry = (cb: (err?: any) => void) => {
const retry = () => {
_rimraf(dir, { maxBusyTries: 1 }, (err: any) => {
if (!err) {
return cb();
return c();
}
if (err.code === 'ENOTEMPTY' && ++retries < 5) {
return setTimeout(() => retry(cb), 10);
return setTimeout(() => retry(), 10);
}
return cb(err);
return e(err);
});
};
retry.taskName = `clean-${path.basename(dir).toLowerCase()}`;
return retry;
retry();
});
result.taskName = `clean-${path.basename(dir).toLowerCase()}`;
return result;
}
export function getVersion(root: string): string | undefined {
@@ -281,3 +286,10 @@ export function versionStringToNumber(versionStr: string) {
return parseInt(match[1], 10) * 1e4 + parseInt(match[2], 10) * 1e2 + parseInt(match[3], 10);
}
export function streamToPromise(stream: NodeJS.ReadWriteStream): Promise<void> {
return new Promise((c, e) => {
stream.on('error', err => e(err));
stream.on('end', () => c());
});
}

View File

@@ -516,7 +516,7 @@ class DeclarationResolver {
'file.ts': fileContents
};
const service = ts.createLanguageService(new TypeScriptLanguageServiceHost({}, fileMap, {}));
const text = service.getEmitOutput('file.ts', true).outputFiles[0].text;
const text = service.getEmitOutput('file.ts', true, true).outputFiles[0].text;
return new CacheEntry(ts.createSourceFile(fileName, text, ts.ScriptTarget.ES5), mtime);
}
}

View File

@@ -617,7 +617,7 @@ export class DeclarationResolver {
'file.ts': fileContents
};
const service = ts.createLanguageService(new TypeScriptLanguageServiceHost({}, fileMap, {}));
const text = service.getEmitOutput('file.ts', true).outputFiles[0].text;
const text = service.getEmitOutput('file.ts', true, true).outputFiles[0].text;
return new CacheEntry(
ts.createSourceFile(fileName, text, ts.ScriptTarget.ES5),
mtime

View File

@@ -44,10 +44,10 @@
"rollup": "^1.20.3",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-node-resolve": "^5.2.0",
"terser": "4.3.1",
"terser": "4.3.8",
"tslint": "^5.9.1",
"service-downloader": "github:anthonydresser/service-downloader#0.1.7",
"typescript": "3.6.2",
"typescript": "3.7.0-dev.20191017",
"vsce": "1.48.0",
"vscode-telemetry-extractor": "^1.5.4",
"xml2js": "^0.4.17"

View File

@@ -29,7 +29,7 @@ dependencies = [
[[package]]
name = "inno_updater"
version = "0.8.0"
version = "0.8.2"
dependencies = [
"byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"crc 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)",

Binary file not shown.

View File

@@ -3482,10 +3482,10 @@ terser@*:
source-map "~0.6.1"
source-map-support "~0.5.12"
terser@4.3.1:
version "4.3.1"
resolved "https://registry.yarnpkg.com/terser/-/terser-4.3.1.tgz#09820bcb3398299c4b48d9a86aefc65127d0ed65"
integrity sha512-pnzH6dnFEsR2aa2SJaKb1uSCl3QmIsJ8dEkj0Fky+2AwMMcC9doMqLOQIH6wVTEKaVfKVvLSk5qxPBEZT9mywg==
terser@4.3.8:
version "4.3.8"
resolved "https://registry.yarnpkg.com/terser/-/terser-4.3.8.tgz#707f05f3f4c1c70c840e626addfdb1c158a17136"
integrity sha512-otmIRlRVmLChAWsnSFNO0Bfk6YySuBp6G9qrHiJwlLDd4mxe2ta4sjI7TzIR+W1nBMjilzrMcPOz9pSusgx3hQ==
dependencies:
commander "^2.20.0"
source-map "~0.6.1"
@@ -3643,10 +3643,10 @@ typed-rest-client@^0.9.0:
tunnel "0.0.4"
underscore "1.8.3"
typescript@3.6.2:
version "3.6.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.6.2.tgz#105b0f1934119dde543ac8eb71af3a91009efe54"
integrity sha512-lmQ4L+J6mnu3xweP8+rOrUwzmN+MRAj7TgtJtDaXE5PMyX2kCrklhg3rvOsOIfNeAWMQWO2F1GPc1kMD2vLAfw==
typescript@3.7.0-dev.20191017:
version "3.7.0-dev.20191017"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.0-dev.20191017.tgz#e61440dd445edea6d7b9a699e7c5d5fbcd1906f2"
integrity sha512-Yi0lCPEN0cn9Gp8TEEkPpgKNR5SWAmx9Hmzzz+oEuivw6amURqRGynaLyFZkMA9iMsvYG5LLqhdlFO3uu5ZT/w==
typescript@^3.0.1:
version "3.5.3"

View File

@@ -6,7 +6,7 @@
"git": {
"name": "chromium",
"repositoryUrl": "https://chromium.googlesource.com/chromium/src",
"commitHash": "c6a08e5368de4352903e702cde750b33239a50ab"
"commitHash": "91f08db83c2ce8c722ddf0911ead8f7c473bedfa"
}
},
"licenseDetail": [
@@ -40,7 +40,7 @@
"SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
],
"isOnlyProductionDependency": true,
"version": "69.0.3497.128"
"version": "76.0.3809.146"
},
{
"component": {
@@ -48,11 +48,11 @@
"git": {
"name": "nodejs",
"repositoryUrl": "https://github.com/nodejs/node",
"commitHash": "8c70b2084ce5f76ea1e3b3c4ccdeee4483fe338b"
"commitHash": "64219741218aa87e259cf8257596073b8e747f0a"
}
},
"isOnlyProductionDependency": true,
"version": "10.11.0"
"version": "12.4.0"
},
{
"component": {
@@ -60,12 +60,12 @@
"git": {
"name": "electron",
"repositoryUrl": "https://github.com/electron/electron",
"commitHash": "4e4c7527c63fcf27dffaeb58bde996b8d859c0ed"
"commitHash": "1e50380fab37f407c4d357e1e30ecbc3d5a703b8"
}
},
"isOnlyProductionDependency": true,
"license": "MIT",
"version": "4.2.10"
"version": "6.0.12"
},
{
"component": {
@@ -96,25 +96,13 @@
"component": {
"type": "git",
"git": {
"name": "vscode-octicons-font",
"repositoryUrl": "https://github.com/Microsoft/vscode-octicons-font",
"commitHash": "4cbf2bd35cf0084eabd47d322cc58339fd7743cf"
"name": "vscode-codicons",
"repositoryUrl": "https://github.com/microsoft/vscode-codicons",
"commitHash": "7f14c092f65f658cd520df3f13765efe828d0ba4"
}
},
"license": "MIT",
"version": "1.3.2"
},
{
"component": {
"type": "git",
"git": {
"name": "octicons",
"repositoryUrl": "https://github.com/primer/octicons",
"commitHash": "d120bf97bc9a12fb415f69fedaf31fe58427ca56"
}
},
"license": "MIT",
"version": "8.3.0"
"license": "MIT and Creative Commons Attribution 4.0",
"version": "0.0.1"
},
{
"component": {

View File

@@ -37,7 +37,8 @@
"launch.json",
"tasks.json",
"keybindings.json",
"extensions.json"
"extensions.json",
"argv.json"
]
}
],
@@ -71,8 +72,8 @@
"url": "vscode://schemas/workspaceConfig"
},
{
"fileMatch": "%APP_SETTINGS_HOME%/locale.json",
"url": "vscode://schemas/locale"
"fileMatch": "**/argv.json",
"url": "vscode://schemas/argv"
},
{
"fileMatch": "/.vscode/settings.json",
@@ -105,6 +106,10 @@
{
"fileMatch": "/.devcontainer.json",
"url": "./schemas/devContainer.schema.json"
},
{
"fileMatch": "%APP_SETTINGS_HOME%/globalStorage/ms-vscode-remote.remote-containers/imageConfigs/*.json",
"url": "./schemas/attachContainer.schema.json"
}
]
},

View File

@@ -0,0 +1,36 @@
{
"$schema": "http://json-schema.org/schema#",
"description": "Configures an attached to container",
"allowComments": true,
"type": "object",
"definitions": {
"attachContainer": {
"type": "object",
"properties": {
"workspaceFolder": {
"type": "string",
"description": "The path of the workspace folder inside the container."
},
"forwardPorts": {
"type": "array",
"description": "Ports that are forwarded from the container to the local machine.",
"items": {
"type": "integer"
}
},
"extensions": {
"type": "array",
"description": "An array of extensions that should be installed into the container.",
"items": {
"type": "string"
}
}
}
}
},
"allOf": [
{
"$ref": "#/definitions/attachContainer"
}
]
}

View File

@@ -75,7 +75,8 @@ function registerVariableCompletions(pattern: string): vscode.Disposable {
{ label: 'fileDirname', detail: localize('fileDirname', "The current opened file's dirname") },
{ label: 'fileExtname', detail: localize('fileExtname', "The current opened file's extension") },
{ label: 'fileBasename', detail: localize('fileBasename', "The current opened file's basename") },
{ label: 'fileBasenameNoExtension', detail: localize('fileBasenameNoExtension', "The current opened file's basename with no file extension") }
{ label: 'fileBasenameNoExtension', detail: localize('fileBasenameNoExtension', "The current opened file's basename with no file extension") },
{ label: 'defaultBuildTask', detail: localize('defaultBuildTask', "The name of the default build task. If there is not a single default build task then a quick pick is shown to choose the build task.") },
].map(variable => ({
label: '${' + variable.label + '}',
range: new vscode.Range(startPosition, position),

View File

@@ -362,6 +362,11 @@
"title": "%command.ignore%",
"category": "Git"
},
{
"command": "git.revealInExplorer",
"title": "%command.revealInExplorer%",
"category": "Git"
},
{
"command": "git.stashIncludeUntracked",
"title": "%command.stashIncludeUntracked%",
@@ -507,6 +512,10 @@
"command": "git.restoreCommitTemplate",
"when": "false"
},
{
"command": "git.revealInExplorer",
"when": "false"
},
{
"command": "git.undoCommit",
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
@@ -913,6 +922,11 @@
"when": "scmProvider == git && scmResourceGroup == merge",
"group": "inline"
},
{
"command": "git.revealInExplorer",
"when": "scmProvider == git && scmResourceGroup == merge",
"group": "2_view"
},
{
"command": "git.openFile2",
"when": "scmProvider == git && scmResourceGroup == merge && config.git.showInlineOpenFileAction && config.git.openDiffOnClick",
@@ -948,6 +962,11 @@
"when": "scmProvider == git && scmResourceGroup == index",
"group": "inline"
},
{
"command": "git.revealInExplorer",
"when": "scmProvider == git && scmResourceGroup == index",
"group": "2_view"
},
{
"command": "git.openFile2",
"when": "scmProvider == git && scmResourceGroup == index && config.git.showInlineOpenFileAction && config.git.openDiffOnClick",
@@ -1007,6 +1026,11 @@
"command": "git.ignore",
"when": "scmProvider == git && scmResourceGroup == workingTree",
"group": "1_modification@3"
},
{
"command": "git.revealInExplorer",
"when": "scmProvider == git && scmResourceGroup == workingTree",
"group": "2_view"
}
],
"editor/title": [

View File

@@ -53,9 +53,10 @@
"command.removeRemote": "Remove Remote",
"command.sync": "Sync",
"command.syncRebase": "Sync (Rebase)",
"command.publish": "Publish Branch",
"command.publish": "Publish Branch...",
"command.showOutput": "Show Git Output",
"command.ignore": "Add to .gitignore",
"command.revealInExplorer": "Reveal in Explorer",
"command.stashIncludeUntracked": "Stash (Include Untracked)",
"command.stash": "Stash",
"command.stashPop": "Pop Stash...",

View File

@@ -28,8 +28,8 @@ function main(argv: string[]): void {
return fatal('Missing pipe');
}
if (process.env['VSCODE_GIT_COMMAND'] === 'fetch') {
return fatal('Skip fetch commands');
if (process.env['VSCODE_GIT_COMMAND'] === 'fetch' && !!process.env['VSCODE_GIT_FETCH_SILENT']) {
return fatal('Skip silent fetch commands');
}
const output = process.env['VSCODE_GIT_ASKPASS_PIPE'] as string;

View File

@@ -100,7 +100,7 @@ export class AutoFetcher {
}
try {
await this.repository.fetchDefault();
await this.repository.fetchDefault({ silent: true });
} catch (err) {
if (err.gitErrorCode === GitErrorCodes.AuthenticationFailed) {
this.disable();

109
extensions/git/src/commands.ts Executable file → Normal file
View File

@@ -132,6 +132,20 @@ class HEADItem implements QuickPickItem {
get alwaysShow(): boolean { return true; }
}
class AddRemoteItem implements QuickPickItem {
constructor(private cc: CommandCenter) { }
get label(): string { return localize('add remote', '$(plus) Add a new remote...'); }
get description(): string { return ''; }
get alwaysShow(): boolean { return true; }
async run(repository: Repository): Promise<void> {
await this.cc.addRemote(repository);
}
}
interface CommandOptions {
repository?: boolean;
diff?: boolean;
@@ -493,7 +507,7 @@ export class CommandCenter {
const repositoryPath = await window.withProgress(
opts,
(_, token) => this.git.clone(url!, parentPath, token)
(progress, token) => this.git.clone(url!, parentPath, progress, token)
);
let message = localize('proposeopen', "Would you like to open the cloned repository?");
@@ -1249,11 +1263,13 @@ export class CommandCenter {
promptToSaveFilesBeforeCommit = 'never';
}
const enableSmartCommit = config.get<boolean>('enableSmartCommit') === true;
if (promptToSaveFilesBeforeCommit !== 'never') {
let documents = workspace.textDocuments
.filter(d => !d.isUntitled && d.isDirty && isDescendant(repository.root, d.uri.fsPath));
if (promptToSaveFilesBeforeCommit === 'staged') {
if (promptToSaveFilesBeforeCommit === 'staged' || repository.indexGroup.resourceStates.length > 0) {
documents = documents
.filter(d => repository.indexGroup.resourceStates.some(s => s.resourceUri.path === d.uri.fsPath));
}
@@ -1275,7 +1291,6 @@ export class CommandCenter {
}
}
const enableSmartCommit = config.get<boolean>('enableSmartCommit') === true;
const enableCommitSigning = config.get<boolean>('enableCommitSigning') === true;
const noStagedChanges = repository.indexGroup.resourceStates.length === 0;
const noUnstagedChanges = repository.workingTreeGroup.resourceStates.length === 0;
@@ -1360,28 +1375,38 @@ export class CommandCenter {
private async commitWithAnyInput(repository: Repository, opts?: CommitOptions): Promise<void> {
const message = repository.inputBox.value;
const getCommitMessage = async () => {
if (message) {
return message;
}
let _message: string | undefined = message;
if (!_message) {
let value: string | undefined = undefined;
if (opts && opts.amend && repository.HEAD && repository.HEAD.commit) {
value = (await repository.getCommit(repository.HEAD.commit)).message;
}
return await window.showInputBox({
const branchName = repository.headShortName;
let placeHolder: string;
if (branchName) {
placeHolder = localize('commitMessageWithHeadLabel2', "Message (commit on '{0}')", branchName);
} else {
placeHolder = localize('commit message', "Commit message");
}
_message = await window.showInputBox({
value,
placeHolder: localize('commit message', "Commit message"),
placeHolder,
prompt: localize('provide commit message', "Please provide a commit message"),
ignoreFocusOut: true
});
}
return _message ? repository.cleanUpCommitEditMessage(_message) : _message;
};
const didCommit = await this.smartCommit(repository, getCommitMessage, opts);
if (message && didCommit) {
repository.inputBox.value = await repository.getCommitTemplate();
repository.inputBox.value = await repository.getInputTemplate();
}
}
@@ -1458,6 +1483,15 @@ export class CommandCenter {
const commit = await repository.getCommit('HEAD');
if (commit.parents.length > 1) {
const yes = localize('undo commit', "Undo merge commit");
const result = await window.showWarningMessage(localize('merge commit', "The last commit was a merge commit. Are you sure you want to undo it?"), yes);
if (result !== yes) {
return;
}
}
if (commit.parents.length > 0) {
await repository.reset('HEAD~');
} else {
@@ -1483,7 +1517,6 @@ export class CommandCenter {
const quickpick = window.createQuickPick();
quickpick.items = picks;
quickpick.placeholder = placeHolder;
quickpick.ignoreFocusOut = true;
quickpick.show();
const choice = await new Promise<QuickPickItem | undefined>(c => quickpick.onDidAccept(() => c(quickpick.activeItems[0])));
@@ -1722,7 +1755,7 @@ export class CommandCenter {
const remoteRefs = repository.refs;
const remoteRefsFiltered = remoteRefs.filter(r => (r.remote === remotePick.label));
const branchPicks = remoteRefsFiltered.map(r => ({ label: r.name })) as { label: string; description: string }[];
const branchPicks = remoteRefsFiltered.map(r => ({ label: r.name! }));
const branchPlaceHolder = localize('pick branch pull', "Pick a branch to pull from");
const branchPick = await window.showQuickPick(branchPicks, { placeHolder: branchPlaceHolder });
@@ -1829,15 +1862,24 @@ export class CommandCenter {
}
} else {
const branchName = repository.HEAD.name;
const picks = remotes.filter(r => r.pushUrl !== undefined).map(r => ({ label: r.name, description: r.pushUrl! }));
const addRemote = new AddRemoteItem(this);
const picks = [...remotes.filter(r => r.pushUrl !== undefined).map(r => ({ label: r.name, description: r.pushUrl })), addRemote];
const placeHolder = localize('pick remote', "Pick a remote to publish the branch '{0}' to:", branchName);
const pick = await window.showQuickPick(picks, { placeHolder });
const choice = await window.showQuickPick(picks, { placeHolder });
if (!pick) {
if (!choice) {
return;
}
await repository.pushTo(pick.label, branchName, undefined, forcePushMode);
if (choice === addRemote) {
const newRemote = await this.addRemote(repository);
if (newRemote) {
await repository.pushTo(newRemote, branchName, undefined, forcePushMode);
}
} else {
await repository.pushTo(choice.label, branchName, undefined, forcePushMode);
}
}
}
@@ -1872,7 +1914,7 @@ export class CommandCenter {
}
@command('git.addRemote', { repository: true })
async addRemote(repository: Repository): Promise<void> {
async addRemote(repository: Repository): Promise<string | undefined> {
const remotes = repository.remotes;
const sanitize = (name: string) => {
@@ -1914,6 +1956,8 @@ export class CommandCenter {
}
await repository.addRemote(name, url);
return name;
}
@command('git.removeRemote', { repository: true })
@@ -2029,19 +2073,25 @@ export class CommandCenter {
return;
}
const addRemote = new AddRemoteItem(this);
const picks = [...repository.remotes.map(r => ({ label: r.name, description: r.pushUrl })), addRemote];
const branchName = repository.HEAD && repository.HEAD.name || '';
const selectRemote = async () => {
const picks = repository.remotes.map(r => r.name);
const placeHolder = localize('pick remote', "Pick a remote to publish the branch '{0}' to:", branchName);
return await window.showQuickPick(picks, { placeHolder });
};
const choice = remotes.length === 1 ? remotes[0].name : await selectRemote();
const choice = await window.showQuickPick(picks, { placeHolder });
if (!choice) {
return;
}
await repository.pushTo(choice, branchName, true);
if (choice === addRemote) {
const newRemote = await this.addRemote(repository);
if (newRemote) {
await repository.pushTo(newRemote, branchName, true);
}
} else {
await repository.pushTo(choice.label, branchName, true);
}
}
@command('git.ignore')
@@ -2069,6 +2119,19 @@ export class CommandCenter {
await this.runByRepository(resources, async (repository, resources) => repository.ignore(resources));
}
@command('git.revealInExplorer')
async revealInExplorer(resourceState: SourceControlResourceState): Promise<void> {
if (!resourceState) {
return;
}
if (!(resourceState.resourceUri instanceof Uri)) {
return;
}
await commands.executeCommand('revealInExplorer', resourceState.resourceUri);
}
private async _stash(repository: Repository, includeUntracked = false): Promise<void> {
const noUnstagedChanges = repository.workingTreeGroup.resourceStates.length === 0;
const noStagedChanges = repository.indexGroup.resourceStates.length === 0;

View File

@@ -12,10 +12,12 @@ import { EventEmitter } from 'events';
import iconv = require('iconv-lite');
import * as filetype from 'file-type';
import { assign, groupBy, denodeify, IDisposable, toDisposable, dispose, mkdirp, readBytes, detectUnicodeEncoding, Encoding, onceEvent, splitInChunks, Limiter } from './util';
import { CancellationToken } from 'vscode';
import { CancellationToken, Progress } from 'vscode';
import { URI } from 'vscode-uri';
import { detectEncoding } from './encoding';
import { Ref, RefType, Branch, Remote, GitErrorCodes, LogOptions, Change, Status } from './api/git';
import * as byline from 'byline';
import { StringDecoder } from 'string_decoder';
// https://github.com/microsoft/vscode/issues/65693
const MAX_CLI_LENGTH = 30000;
@@ -163,6 +165,7 @@ export interface SpawnOptions extends cp.SpawnOptions {
encoding?: string;
log?: boolean;
cancellationToken?: CancellationToken;
onSpawn?: (childProcess: cp.ChildProcess) => void;
}
async function exec(child: cp.ChildProcess, cancellationToken?: CancellationToken): Promise<IExecutionResult<Buffer>> {
@@ -341,7 +344,7 @@ export class Git {
return;
}
async clone(url: string, parentPath: string, cancellationToken?: CancellationToken): Promise<string> {
async clone(url: string, parentPath: string, progress: Progress<{ increment: number }>, cancellationToken?: CancellationToken): Promise<string> {
let baseFolderName = decodeURI(url).replace(/[\/]+$/, '').replace(/^.*[\/\\]/, '').replace(/\.git$/, '') || 'repository';
let folderName = baseFolderName;
let folderPath = path.join(parentPath, folderName);
@@ -354,8 +357,36 @@ export class Git {
await mkdirp(parentPath);
const onSpawn = (child: cp.ChildProcess) => {
const decoder = new StringDecoder('utf8');
const lineStream = new byline.LineStream({ encoding: 'utf8' });
child.stderr.on('data', (buffer: Buffer) => lineStream.write(decoder.write(buffer)));
let totalProgress = 0;
let previousProgress = 0;
lineStream.on('data', (line: string) => {
let match: RegExpMatchArray | null = null;
if (match = /Counting objects:\s*(\d+)%/i.exec(line)) {
totalProgress = Math.floor(parseInt(match[1]) * 0.1);
} else if (match = /Compressing objects:\s*(\d+)%/i.exec(line)) {
totalProgress = 10 + Math.floor(parseInt(match[1]) * 0.1);
} else if (match = /Receiving objects:\s*(\d+)%/i.exec(line)) {
totalProgress = 20 + Math.floor(parseInt(match[1]) * 0.4);
} else if (match = /Resolving deltas:\s*(\d+)%/i.exec(line)) {
totalProgress = 60 + Math.floor(parseInt(match[1]) * 0.4);
}
if (totalProgress !== previousProgress) {
progress.report({ increment: totalProgress - previousProgress });
previousProgress = totalProgress;
}
});
};
try {
await this.exec(parentPath, ['clone', url.includes(' ') ? encodeURI(url) : url, folderPath], { cancellationToken });
await this.exec(parentPath, ['clone', url.includes(' ') ? encodeURI(url) : url, folderPath, '--progress'], { cancellationToken, onSpawn });
} catch (err) {
if (err.stderr) {
err.stderr = err.stderr.replace(/^Cloning.+$/m, '').trim();
@@ -370,7 +401,8 @@ export class Git {
async getRepositoryRoot(repositoryPath: string): Promise<string> {
const result = await this.exec(repositoryPath, ['rev-parse', '--show-toplevel']);
return path.normalize(result.stdout.trim());
// Keep trailing spaces which are part of the directory name
return path.normalize(result.stdout.trimLeft().replace(/(\r\n|\r|\n)+$/, ''));
}
async getRepositoryDotGit(repositoryPath: string): Promise<string> {
@@ -401,6 +433,10 @@ export class Git {
private async _exec(args: string[], options: SpawnOptions = {}): Promise<IExecutionResult<string>> {
const child = this.spawn(args, options);
if (options.onSpawn) {
options.onSpawn(child);
}
if (options.input) {
child.stdin.end(options.input, 'utf8');
}
@@ -1366,8 +1402,9 @@ export class Repository {
await this.run(args);
}
async fetch(options: { remote?: string, ref?: string, all?: boolean, prune?: boolean, depth?: number } = {}): Promise<void> {
async fetch(options: { remote?: string, ref?: string, all?: boolean, prune?: boolean, depth?: number, silent?: boolean } = {}): Promise<void> {
const args = ['fetch'];
const spawnOptions: SpawnOptions = {};
if (options.remote) {
args.push(options.remote);
@@ -1387,8 +1424,12 @@ export class Repository {
args.push(`--depth=${options.depth}`);
}
if (options.silent) {
spawnOptions.env = { 'VSCODE_GIT_FETCH_SILENT': 'true' };
}
try {
await this.run(args);
await this.run(args, spawnOptions);
} catch (err) {
if (/No remote repository specified\./.test(err.stderr || '')) {
err.gitErrorCode = GitErrorCodes.NoRemoteRepositorySpecified;
@@ -1748,6 +1789,23 @@ export class Repository {
}
}
cleanupCommitEditMessage(message: string): string {
//TODO: Support core.commentChar
return message.replace(/^\s*#.*$\n?/gm, '').trim();
}
async getMergeMessage(): Promise<string | undefined> {
const mergeMsgPath = path.join(this.repositoryRoot, '.git', 'MERGE_MSG');
try {
const raw = await readfile(mergeMsgPath, 'utf8');
return raw.trim();
} catch {
return undefined;
}
}
async getCommitTemplate(): Promise<string> {
try {
const result = await this.run(['config', '--get', 'commit.template']);
@@ -1766,7 +1824,7 @@ export class Repository {
}
const raw = await readfile(templatePath, 'utf8');
return raw.replace(/^\s*#.*$\n?/gm, '');
return raw.trim();
} catch (err) {
return '';

View File

@@ -579,6 +579,27 @@ export class Repository implements Disposable {
return this._refs;
}
get headShortName(): string | undefined {
if (!this.HEAD) {
return;
}
const HEAD = this.HEAD;
if (HEAD.name) {
return HEAD.name;
}
const tag = this.refs.filter(iref => iref.type === RefType.Tag && iref.commit === HEAD.commit)[0];
const tagName = tag && tag.name;
if (tagName) {
return tagName;
}
return (HEAD.commit || '').substr(0, 8);
}
private _remotes: Remote[] = [];
get remotes(): Remote[] {
return this._remotes;
@@ -729,8 +750,6 @@ export class Repository implements Disposable {
const onDidChangeCountBadge = filterEvent(workspace.onDidChangeConfiguration, e => e.affectsConfiguration('git.countBadge', root));
onDidChangeCountBadge(this.setCountBadge, this, this.disposables);
this.setCountBadge();
this.updateCommitTemplate();
}
validateInput(text: string, position: number): SourceControlInputBoxValidation | undefined {
@@ -806,12 +825,14 @@ export class Repository implements Disposable {
return toGitUri(uri, '', { replaceFileExtension: true });
}
private async updateCommitTemplate(): Promise<void> {
try {
this._sourceControl.commitTemplate = await this.repository.getCommitTemplate();
} catch (e) {
// noop
async getInputTemplate(): Promise<string> {
const mergeMessage = await this.repository.getMergeMessage();
if (mergeMessage) {
return mergeMessage;
}
return await this.repository.getCommitTemplate();
}
getConfigs(): Promise<{ key: string; value: string; }[]> {
@@ -1033,8 +1054,8 @@ export class Repository implements Disposable {
}
@throttle
async fetchDefault(): Promise<void> {
await this.run(Operation.Fetch, () => this.repository.fetch());
async fetchDefault(options: { silent?: boolean } = {}): Promise<void> {
await this.run(Operation.Fetch, () => this.repository.fetch(options));
}
@throttle
@@ -1236,6 +1257,10 @@ export class Repository implements Disposable {
return await this.run(Operation.GetCommitTemplate, async () => this.repository.getCommitTemplate());
}
async cleanUpCommitEditMessage(editMessage: string): Promise<string> {
return this.repository.cleanupCommitEditMessage(editMessage);
}
async ignore(files: Uri[]): Promise<void> {
return await this.run(Operation.Ignore, async () => {
const ignoreFile = `${this.repository.root}${path.sep}.gitignore`;
@@ -1457,9 +1482,9 @@ export class Repository implements Disposable {
const [refs, remotes, submodules, rebaseCommit] = await Promise.all([this.repository.getRefs({ sort }), this.repository.getRemotes(), this.repository.getSubmodules(), this.getRebaseCommit()]);
this._HEAD = HEAD;
this._refs = refs;
this._remotes = remotes;
this._submodules = submodules;
this._refs = refs!;
this._remotes = remotes!;
this._submodules = submodules!;
this.rebaseCommit = rebaseCommit;
const index: Resource[] = [];
@@ -1507,6 +1532,8 @@ export class Repository implements Disposable {
this.setCountBadge();
this._onDidChangeStatus.fire();
this._sourceControl.commitTemplate = await this.getInputTemplate();
}
private setCountBadge(): void {
@@ -1643,15 +1670,11 @@ export class Repository implements Disposable {
}
private updateInputBoxPlaceholder(): void {
const HEAD = this.HEAD;
if (HEAD) {
const tag = this.refs.filter(iref => iref.type === RefType.Tag && iref.commit === HEAD.commit)[0];
const tagName = tag && tag.name;
const head = HEAD.name || tagName || (HEAD.commit || '').substr(0, 8);
const branchName = this.headShortName;
if (branchName) {
// '{0}' will be replaced by the corresponding key-command later in the process, which is why it needs to stay.
this._sourceControl.inputBox.placeholder = localize('commitMessageWithHeadLabel', "Message ({0} to commit on '{1}')", "{0}", head);
this._sourceControl.inputBox.placeholder = localize('commitMessageWithHeadLabel', "Message ({0} to commit on '{1}')", "{0}", branchName);
} else {
this._sourceControl.inputBox.placeholder = localize('commitMessage', "Message ({0} to commit)");
}

View File

@@ -160,7 +160,7 @@ export async function mkdirp(path: string, mode?: number): Promise<boolean> {
if (err.code === 'EEXIST') {
const stat = await nfcall<fs.Stats>(fs.stat, path);
if (stat.isDirectory) {
if (stat.isDirectory()) {
return;
}

View File

@@ -1,3 +1,17 @@
# Image Preview
**Notice:** This extension is bundled with Visual Studio Code. It can be disabled but not uninstalled.
## Features
This extension provides VS Code's built-in image preview functionality.
Supported image formats:
- `*.jpg`, `*.jpe`, `*.jpeg`
- `*.png`
- `*.bmp`
- `*.gif`
- `*.ico`
- `*.tga`
- `*.webp`

View File

@@ -4,8 +4,9 @@
*--------------------------------------------------------------------------------------------*/
html, body {
width: 100%;
height: 100%;
max-height: 100%;
text-align: center;
}
body img {
@@ -77,22 +78,38 @@ body img {
margin-left: 5px;
}
.loading {
position: fixed;
.container.loading,
.container.error {
display: flex;
justify-content: center;
align-items: center;
}
.loading-indicator {
width: 30px;
height: 30px;
left: 50%;
top: 50%;
margin-top: -15px;
margin-left: -15px;
background-image: url('./loading.svg');
background-size: cover;
}
.vscode-dark .loading {
.loading-indicator,
.image-load-error-message {
display: none;
}
.loading .loading-indicator,
.error .image-load-error-message {
display: block;
}
.image-load-error-message {
margin: 1em;
}
.vscode-dark .loading-indicator {
background-image: url('./loading-dark.svg');
}
.vscode-high-contrast .loading {
.vscode-high-contrast .loading-indicator {
background-image: url('./loading-hc.svg');
}

View File

@@ -70,9 +70,10 @@
let ctrlPressed = false;
let altPressed = false;
let hasLoadedImage = false;
let consumeClick = false;
// Elements
const container = /** @type {HTMLElement} */(document.querySelector('body'));
const container = document.body;
const image = document.createElement('img');
function updateScale(newScale) {
@@ -88,9 +89,6 @@
image.style.width = 'auto';
vscode.setState(undefined);
} else {
const oldWidth = image.width;
const oldHeight = image.height;
scale = clamp(newScale, MIN_SCALE, MAX_SCALE);
if (scale >= PIXELATION_THRESHOLD) {
image.classList.add('pixelated');
@@ -98,25 +96,19 @@
image.classList.remove('pixelated');
}
const { scrollTop, scrollLeft } = image.parentElement;
const dx = (scrollLeft + image.parentElement.clientWidth / 2) / image.parentElement.scrollWidth;
const dy = (scrollTop + image.parentElement.clientHeight / 2) / image.parentElement.scrollHeight;
const dx = (window.scrollX + container.clientWidth / 2) / container.scrollWidth;
const dy = (window.scrollY + container.clientHeight / 2) / container.scrollHeight;
image.classList.remove('scale-to-fit');
image.style.minWidth = `${(image.naturalWidth * scale)}px`;
image.style.width = `${(image.naturalWidth * scale)}px`;
const newWidth = image.width;
const scaleFactor = (newWidth - oldWidth) / oldWidth;
const newScrollX = container.scrollWidth * dx - container.clientWidth / 2;
const newScrollY = container.scrollHeight * dy - container.clientHeight / 2;
const newScrollLeft = ((oldWidth * scaleFactor * dx) + scrollLeft);
const newScrollTop = ((oldHeight * scaleFactor * dy) + scrollTop);
// scrollbar.setScrollPosition({
// scrollLeft: newScrollLeft,
// scrollTop: newScrollTop,
// });
window.scrollTo(newScrollX, newScrollY);
vscode.setState({ scale: scale, offsetX: newScrollLeft, offsetY: newScrollTop });
vscode.setState({ scale: scale, offsetX: newScrollX, offsetY: newScrollY });
}
vscode.postMessage({
@@ -125,6 +117,18 @@
});
}
function changeActive(value) {
if (value) {
container.classList.add('zoom-in');
consumeClick = true;
} else {
ctrlPressed = false;
altPressed = false;
container.classList.remove('zoom-out');
container.classList.remove('zoom-in');
}
}
function firstZoom() {
if (!image || !hasLoadedImage) {
return;
@@ -161,6 +165,18 @@
}
});
container.addEventListener('mousedown', (/** @type {MouseEvent} */ e) => {
if (!image || !hasLoadedImage) {
return;
}
if (e.button !== 0) {
return;
}
consumeClick = false;
});
container.addEventListener('click', (/** @type {MouseEvent} */ e) => {
if (!image || !hasLoadedImage) {
return;
@@ -170,6 +186,18 @@
return;
}
ctrlPressed = e.ctrlKey;
altPressed = e.altKey;
if (isMac ? altPressed : ctrlPressed) {
container.classList.remove('zoom-in');
container.classList.add('zoom-out');
}
if (consumeClick) {
consumeClick = false;
return;
}
// left click
if (scale === 'fit') {
firstZoom();
@@ -227,24 +255,19 @@
});
container.classList.add('image');
container.classList.add('zoom-in');
image.classList.add('scale-to-fit');
image.addEventListener('load', () => {
document.querySelector('.loading').remove();
hasLoadedImage = true;
if (!image) {
return;
}
vscode.postMessage({
type: 'size',
value: `${image.naturalWidth}x${image.naturalHeight}`,
});
container.classList.add('ready');
document.body.classList.remove('loading');
document.body.classList.add('ready');
document.body.append(image);
updateScale(scale);
@@ -254,6 +277,12 @@
}
});
image.addEventListener('error', () => {
hasLoadedImage = true;
document.body.classList.add('error');
document.body.classList.remove('loading');
});
image.src = decodeURI(settings.src);
window.addEventListener('message', e => {
@@ -261,6 +290,9 @@
case 'setScale':
updateScale(e.data.scale);
break;
case 'setActive':
changeActive(e.data.value);
break;
}
});
}());

View File

@@ -24,9 +24,10 @@
{
"viewType": "imagePreview.previewEditor",
"displayName": "%webviewEditors.displayName%",
"priority": "builtin",
"selector": [
{
"filenamePattern": "*.{jpg,jpe,jpeg,png,bmp,gif,ico,tga,tif,tiff,webp}",
"filenamePattern": "*.{jpg,jpe,jpeg,png,bmp,gif,ico,tga,webp}",
"mime": "image/*"
}
]

View File

@@ -1,5 +1,5 @@
{
"displayName": "Image Preview",
"description": "Previews images.",
"description": "Provides VS Code's built-in image preview",
"webviewEditors.displayName": "Image Preview"
}

View File

@@ -4,19 +4,32 @@
*--------------------------------------------------------------------------------------------*/
import * as vscode from 'vscode';
import { SizeStatusBarEntry } from './sizeStatusBarEntry';
import { ZoomStatusBarEntry } from './zoomStatusBarEntry';
import * as nls from 'vscode-nls';
import { Disposable } from './dispose';
import { SizeStatusBarEntry } from './sizeStatusBarEntry';
import { Scale, ZoomStatusBarEntry } from './zoomStatusBarEntry';
const localize = nls.loadMessageBundle();
const enum PreviewState {
Disposed,
Visible,
Active,
}
export class Preview extends Disposable {
public static readonly viewType = 'imagePreview.previewEditor';
private _active = true;
private readonly id: string = `${Date.now()}-${Math.random().toString()}`;
private _previewState = PreviewState.Visible;
private _imageSize: string | undefined;
private _imageZoom: Scale | undefined;
constructor(
private readonly extensionRoot: vscode.Uri,
resource: vscode.Uri,
private readonly resource: vscode.Uri,
private readonly webviewEditor: vscode.WebviewEditor,
private readonly sizeStatusBarEntry: SizeStatusBarEntry,
private readonly zoomStatusBarEntry: ZoomStatusBarEntry,
@@ -34,56 +47,91 @@ export class Preview extends Disposable {
]
};
webviewEditor.webview.html = this.getWebiewContents(webviewEditor, resource);
this._register(webviewEditor.webview.onDidReceiveMessage(message => {
switch (message.type) {
case 'size':
{
this.sizeStatusBarEntry.update(message.value);
this._imageSize = message.value;
this.update();
break;
}
case 'zoom':
{
this.zoomStatusBarEntry.update(message.value);
this._imageZoom = message.value;
this.update();
break;
}
}
}));
this._register(zoomStatusBarEntry.onDidChangeScale(e => {
if (this._previewState === PreviewState.Active) {
this.webviewEditor.webview.postMessage({ type: 'setScale', scale: e.scale });
}
}));
this._register(webviewEditor.onDidChangeViewState(() => {
this.update();
}));
this._register(webviewEditor.onDidDispose(() => {
if (this._active) {
this.sizeStatusBarEntry.hide();
this.zoomStatusBarEntry.hide();
if (this._previewState === PreviewState.Active) {
this.sizeStatusBarEntry.hide(this.id);
this.zoomStatusBarEntry.hide(this.id);
}
this._previewState = PreviewState.Disposed;
}));
const watcher = this._register(vscode.workspace.createFileSystemWatcher(resource.fsPath));
this._register(watcher.onDidChange(e => {
if (e.toString() === this.resource.toString()) {
this.render();
}
}));
this._register(watcher.onDidDelete(e => {
if (e.toString() === this.resource.toString()) {
this.webviewEditor.dispose();
}
}));
this.render();
this.update();
}
private update() {
this._active = this.webviewEditor.active;
if (this._active) {
this.sizeStatusBarEntry.show();
this.zoomStatusBarEntry.show();
} else {
this.sizeStatusBarEntry.hide();
this.zoomStatusBarEntry.hide();
private render() {
if (this._previewState !== PreviewState.Disposed) {
this.webviewEditor.webview.html = this.getWebiewContents();
}
}
private getWebiewContents(webviewEditor: vscode.WebviewEditor, resource: vscode.Uri): string {
private update() {
if (this._previewState === PreviewState.Disposed) {
return;
}
if (this.webviewEditor.active) {
this._previewState = PreviewState.Active;
this.sizeStatusBarEntry.show(this.id, this._imageSize || '');
this.zoomStatusBarEntry.show(this.id, this._imageZoom || 'fit');
} else {
if (this._previewState === PreviewState.Active) {
this.sizeStatusBarEntry.hide(this.id);
this.zoomStatusBarEntry.hide(this.id);
}
this._previewState = PreviewState.Visible;
}
this.webviewEditor.webview.postMessage({ type: 'setActive', value: this.webviewEditor.active });
}
private getWebiewContents(): string {
const version = Date.now().toString();
const settings = {
isMac: process.platform === 'darwin',
src: this.getResourcePath(webviewEditor, resource)
src: this.getResourcePath(this.webviewEditor, this.resource, version),
};
const nonce = Date.now().toString();
return /* html */`<!DOCTYPE html>
<html lang="en">
<head>
@@ -91,23 +139,33 @@ export class Preview extends Disposable {
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Image Preview</title>
<link rel="stylesheet" class="code-user-style" href="${escapeAttribute(this.extensionResource('/media/main.css'))}" type="text/css" media="screen">
<link rel="stylesheet" href="${escapeAttribute(this.extensionResource('/media/main.css'))}" type="text/css" media="screen" nonce="${nonce}">
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src 'self' data: ${this.webviewEditor.webview.cspSource}; script-src 'nonce-${nonce}'; style-src 'self' 'nonce-${nonce}';">
<meta id="image-preview-settings" data-settings="${escapeAttribute(JSON.stringify(settings))}">
</head>
<body class="container image scale-to-fit">
<div class='loading'></div>
<script src="${escapeAttribute(this.extensionResource('/media/main.js'))}"></script>
<body class="container image scale-to-fit loading">
<div class="loading-indicator"></div>
<div class="image-load-error-message">${localize('preview.imageLoadError', "An error occurred while loading the image")}</div>
<script src="${escapeAttribute(this.extensionResource('/media/main.js'))}" nonce="${nonce}"></script>
</body>
</html>`;
}
private getResourcePath(webviewEditor: vscode.WebviewEditor, resource: vscode.Uri) {
if (resource.scheme === 'data') {
private getResourcePath(webviewEditor: vscode.WebviewEditor, resource: vscode.Uri, version: string) {
switch (resource.scheme) {
case 'data':
return encodeURI(resource.toString(true));
}
return encodeURI(webviewEditor.webview.asWebviewUri(resource).toString(true));
case 'git':
// Show blank image
return encodeURI('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAEElEQVR42gEFAPr/AP///wAI/AL+Sr4t6gAAAABJRU5ErkJggg==');
default:
return encodeURI(webviewEditor.webview.asWebviewUri(resource).toString(true) + `?version=${version}`);
}
}
private extensionResource(path: string) {

View File

@@ -5,29 +5,35 @@
import * as vscode from 'vscode';
import { Disposable } from './dispose';
import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();
export class SizeStatusBarEntry extends Disposable {
private readonly _entry: vscode.StatusBarItem;
private _showingOwner: string | undefined;
constructor() {
super();
this._entry = this._register(vscode.window.createStatusBarItem({
id: 'imagePreview.size',
name: 'Image Size',
name: localize('sizeStatusBar.name', "Image Size"),
alignment: vscode.StatusBarAlignment.Right,
priority: 101 /* to the left of editor status (100) */,
}));
}
public show() {
public show(owner: string, text: string) {
this._showingOwner = owner;
this._entry.text = text;
this._entry.show();
}
public hide() {
public hide(owner: string) {
if (owner === this._showingOwner) {
this._entry.hide();
}
public update(text: string) {
this._entry.text = text;
this._showingOwner = undefined;
}
}
}

View File

@@ -11,7 +11,7 @@ const localize = nls.loadMessageBundle();
const selectZoomLevelCommandId = '_imagePreview.selectZoomLevel';
type Scale = number | 'fit';
export type Scale = number | 'fit';
export class ZoomStatusBarEntry extends Disposable {
private readonly _entry: vscode.StatusBarItem;
@@ -19,11 +19,13 @@ export class ZoomStatusBarEntry extends Disposable {
private readonly _onDidChangeScale = this._register(new vscode.EventEmitter<{ scale: Scale }>());
public readonly onDidChangeScale = this._onDidChangeScale.event;
private _showOwner: string | undefined;
constructor() {
super();
this._entry = this._register(vscode.window.createStatusBarItem({
id: 'imagePreview.zoom',
name: 'Image Zoom',
name: localize('zoomStatusBar.name', "Image Zoom"),
alignment: vscode.StatusBarAlignment.Right,
priority: 102 /* to the left of editor size entry (101) */,
}));
@@ -48,16 +50,17 @@ export class ZoomStatusBarEntry extends Disposable {
this._entry.command = selectZoomLevelCommandId;
}
public show() {
public show(owner: string, scale: Scale) {
this._showOwner = owner;
this._entry.text = this.zoomLabel(scale);
this._entry.show();
}
public hide() {
public hide(owner: string) {
if (owner === this._showOwner) {
this._entry.hide();
this._showOwner = undefined;
}
public update(scale: Scale) {
this._entry.text = this.zoomLabel(scale);
}
private zoomLabel(scale: Scale): string {

View File

@@ -44,7 +44,7 @@ The JSON language server has the following dependencies on the client's capabili
The client can send the following initialization options to the server:
- `provideFormatter: boolean | undefined`. If defined, the value defines wheter the server provides the `documentRangeFormattingProvider` capability on initialization. If undefined, the setting `json.format.enable` is used to determined wheter formatting is provided. The formatter will then be registered through dynamic registration. If the client does not support dynamic registration, no formatter will be available.
- `provideFormatter: boolean | undefined`. If defined, the value defines whether the server provides the `documentRangeFormattingProvider` capability on initialization. If undefined, the setting `json.format.enable` is used to determine whether formatting is provided. The formatter will then be registered through dynamic registration. If the client does not support dynamic registration, no formatter will be available.
- `handledSchemaProtocols`: The URI schemas handles by the server. See section `Schema configuration` below.
### Settings
@@ -60,7 +60,7 @@ The server supports the following settings:
- `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.
- `schema`: Configures association of file names to schema URL or schemas and/or associations of schema URL to schema content.
- `fileMatch`: an array or 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.
- `url`: The URL of the schema, optional when also a schema is provided.
- `schema`: The schema content.
@@ -99,9 +99,9 @@ To find the schema for a given JSON document, the server uses the following mech
- The settings define a schema association based on the documents URL. Settings can either associate a schema URL to a file or path pattern, and they can directly provide a schema.
- Additionally, schema associations can also be provided by a custom 'schemaAssociations' configuration call.
Schemas are identified by URLs. To load the content of a schema, the JSON language server either tries to load from that URI or path itself, or delegates to the client.
Schemas are identified by URLs. To load the content of a schema, the JSON language server either tries to load from that URI or path itself or delegates to the client.
The `initializationOptions.handledSchemaProtocols` initialization option defines which URLs are handled by the server. Requests for all other URIs are send to the client.
The `initializationOptions.handledSchemaProtocols` initialization option defines which URLs are handled by the server. Requests for all other URIs are sent to the client.
`handledSchemaProtocols` is part of the initialization options and can't be changed while the server is running.
@@ -121,7 +121,7 @@ If `handledSchemaProtocols` is not set, the JSON language server will load the f
#### Schema content request
Requests for schemas with URLs not handled by the server are forwarded to the client through an LSP request. This request is a JSON language server specific, non-standardized, extension to the LSP.
Requests for schemas with URLs not handled by the server are forwarded to the client through an LSP request. This request is a JSON language server-specific, non-standardized, extension to the LSP.
Request:
- method: 'vscode/content'
@@ -130,12 +130,12 @@ Request:
#### Schema content change notification
When the client is aware that a schema content has changed, it will notify the server through a notification. This notification is a JSON language server specific, non-standardized, extension to the LSP.
When the client is aware that a schema content has changed, it will notify the server through a notification. This notification is a JSON language server-specific, non-standardized, extension to the LSP.
The server will, as a response, clear the schema content from the cache and reload the schema content when required again.
#### Schema associations notification
In addition to the settings, schemas associations can also be provided through a notification from the client to the server. This notification is a JSON language server specific, non-standardized, extension to the LSP.
In addition to the settings, schemas associations can also be provided through a notification from the client to the server. This notification is a JSON language server-specific, non-standardized, extension to the LSP.
Notification:
- method: 'json/schemaAssociations'

View File

@@ -1,7 +1,7 @@
{
"name": "vscode-json-languageserver",
"description": "JSON language server",
"version": "1.2.1",
"version": "1.2.2",
"author": "Microsoft Corporation",
"license": "MIT",
"engines": {

View File

@@ -144,7 +144,7 @@ connection.onInitialize((params: InitializeParams): InitializeResult => {
}
clientSnippetSupport = getClientCapability('textDocument.completion.completionItem.snippetSupport', false);
dynamicFormatterRegistration = getClientCapability('textDocument.rangeFormatting.dynamicRegistration', false) && (params.initializationOptions.provideFormatter === undefined);
dynamicFormatterRegistration = getClientCapability('textDocument.rangeFormatting.dynamicRegistration', false) && (typeof params.initializationOptions.provideFormatter !== 'boolean');
foldingRangeLimit = getClientCapability('textDocument.foldingRange.rangeLimit', Number.MAX_VALUE);
hierarchicalDocumentSymbolSupport = getClientCapability('textDocument.documentSymbol.hierarchicalDocumentSymbolSupport', false);
const capabilities: ServerCapabilities = {
@@ -153,11 +153,10 @@ connection.onInitialize((params: InitializeParams): InitializeResult => {
completionProvider: clientSnippetSupport ? { resolveProvider: true, triggerCharacters: ['"', ':'] } : undefined,
hoverProvider: true,
documentSymbolProvider: true,
documentRangeFormattingProvider: false,
documentRangeFormattingProvider: params.initializationOptions.provideFormatter === true,
colorProvider: {},
foldingRangeProvider: true,
selectionRangeProvider: true,
documentFormattingProvider: params.initializationOptions.provideFormatter === true
selectionRangeProvider: true
};
return { capabilities };

View File

@@ -12,7 +12,6 @@
{ "open": "[", "close": "]", "notIn": ["string"] },
{ "open": "(", "close": ")", "notIn": ["string"] },
{ "open": "'", "close": "'", "notIn": ["string"] },
{ "open": "/*", "close": "*/", "notIn": ["string"] },
{ "open": "\"", "close": "\"", "notIn": ["string", "comment"] },
{ "open": "`", "close": "`", "notIn": ["string", "comment"] }
]

View File

@@ -27,7 +27,8 @@
".swcrc",
".webmanifest",
".js.map",
".css.map"
".css.map",
".har"
],
"filenames": [
"composer.lock",

View File

@@ -4,7 +4,7 @@
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
"Once accepted there, we are happy to receive an update request."
],
"version": "https://github.com/microsoft/vscode-markdown-tm-grammar/commit/00b05ebe6850083664d92d0eba6e5ee8f153baa6",
"version": "https://github.com/microsoft/vscode-markdown-tm-grammar/commit/46724e2885f9557400ed91727d75c3574ceded3a",
"name": "Markdown",
"scopeName": "text.html.markdown",
"patterns": [
@@ -1682,6 +1682,39 @@
}
]
},
"fenced_code_block_log": {
"begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(log)(\\s+[^`~]*)?$)",
"name": "markup.fenced_code.block.markdown",
"end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
"beginCaptures": {
"3": {
"name": "punctuation.definition.markdown"
},
"4": {
"name": "fenced_code.block.language.markdown"
},
"5": {
"name": "fenced_code.block.language.attributes.markdown"
}
},
"endCaptures": {
"3": {
"name": "punctuation.definition.markdown"
}
},
"patterns": [
{
"begin": "(^|\\G)(\\s*)(.*)",
"while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
"contentName": "meta.embedded.block.log",
"patterns": [
{
"include": "text.log"
}
]
}
]
},
"fenced_code_block": {
"patterns": [
{
@@ -1831,6 +1864,9 @@
{
"include": "#fenced_code_block_markdown"
},
{
"include": "#fenced_code_block_log"
},
{
"include": "#fenced_code_block_unknown"
}

View File

@@ -123,26 +123,33 @@ Visual Studio-like style based on original C# coloring by Jason Diamond <jason@d
*/
.vscode-light .hljs-function,
.vscode-light .hljs-params {
.vscode-light .hljs-params,
.vscode-light .hljs-number,
.vscode-light .hljs-class {
color: inherit;
}
.vscode-light .hljs-comment,
.vscode-light .hljs-quote,
.vscode-light .hljs-number,
.vscode-light .hljs-class,
.vscode-light .hljs-variable {
color: #008000;
}
.vscode-light .hljs-keyword,
.vscode-light .hljs-selector-tag,
.vscode-light .hljs-built_in,
.vscode-light .hljs-name,
.vscode-light .hljs-tag {
color: #00f;
}
.vscode-light .hljs-built_in,
.vscode-light .hljs-builtin-name {
color: #007acc;
}
.vscode-light .hljs-string,
.vscode-light .hljs-title,
.vscode-light .hljs-section,
.vscode-light .hljs-attribute,
.vscode-light .hljs-literal,
@@ -154,10 +161,12 @@ Visual Studio-like style based on original C# coloring by Jason Diamond <jason@d
.vscode-light .hljs-selector-attr,
.vscode-light .hljs-selector-pseudo,
.vscode-light .hljs-meta {
.vscode-light .hljs-meta,
.vscode-light .hljs-meta-keyword {
color: #2b91af;
}
.vscode-light .hljs-title,
.vscode-light .hljs-doctag {
color: #808080;
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -324,11 +324,11 @@
"watch": "npm run build-preview && gulp watch-extension:markdown-language-features",
"vscode:prepublish": "npm run build-ext && npm run build-preview",
"build-ext": "node ../../node_modules/gulp/bin/gulp.js --gulpfile ../../build/gulpfile.extensions.js compile-extension:markdown-language-features ./tsconfig.json",
"build-preview": "webpack --mode development"
"build-preview": "webpack --mode production"
},
"dependencies": {
"highlight.js": "9.15.8",
"markdown-it": "^9.1.0",
"highlight.js": "9.15.10",
"markdown-it": "^10.0.0",
"markdown-it-front-matter": "^0.1.2",
"vscode-extension-telemetry": "0.1.1",
"vscode-nls": "^4.0.0"

View File

@@ -19,7 +19,7 @@ const settings = getSettings();
const vscode = acquireVsCodeApi();
// Set VS Code state
let state = getData<{ line: number, fragment: string }>('data-state');
let state = getData<{ line: number; fragment: string; }>('data-state');
vscode.setState(state);
const messaging = createPosterForVsCode(vscode);
@@ -67,7 +67,7 @@ const onUpdateView = (() => {
})();
let updateImageSizes = throttle(() => {
const imageInfo: { id: string, height: number, width: number }[] = [];
const imageInfo: { id: string, height: number, width: number; }[] = [];
let images = document.getElementsByTagName('img');
if (images) {
let i;
@@ -129,6 +129,8 @@ document.addEventListener('dblclick', event => {
}
});
const passThroughLinkSchemes = ['http:', 'https:', 'mailto:', 'vscode:', 'vscode-insiders'];
document.addEventListener('click', event => {
if (!event) {
return;
@@ -138,22 +140,30 @@ document.addEventListener('click', event => {
while (node) {
if (node.tagName && node.tagName === 'A' && node.href) {
if (node.getAttribute('href').startsWith('#')) {
break;
return;
}
if (node.href.startsWith('file://') || node.href.startsWith('vscode-resource:') || node.href.startsWith(settings.webviewResourceRoot)) {
const [path, fragment] = node.href.replace(/^(file:\/\/|vscode-resource:)/i, '').replace(new RegExp(`^${escapeRegExp(settings.webviewResourceRoot)}`)).split('#');
messaging.postMessage('clickLink', { path, fragment });
// Pass through known schemes
if (passThroughLinkSchemes.some(scheme => node.href.startsWith(scheme))) {
return;
}
const hrefText = node.getAttribute('data-href') || node.getAttribute('href');
// If original link doesn't look like a url, delegate back to VS Code to resolve
if (!/^[a-z\-]+:/i.test(hrefText)) {
messaging.postMessage('openLink', { href: hrefText });
event.preventDefault();
event.stopPropagation();
break;
return;
}
break;
return;
}
node = node.parentNode;
}
}, true);
if (settings.scrollEditorWithPreview) {
window.addEventListener('scroll', throttle(() => {
if (scrollDisabled) {
scrollDisabled = false;
@@ -166,8 +176,4 @@ if (settings.scrollEditorWithPreview) {
}
}
}, 50));
}
function escapeRegExp(text: string) {
return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
}

View File

@@ -56,7 +56,7 @@ function registerMarkdownLanguageFeatures(
return vscode.Disposable.from(
vscode.languages.setLanguageConfiguration('markdown', {
wordPattern: new RegExp('(\\p{Alphabetic}|\\p{Number})+', 'ug'),
wordPattern: new RegExp('(\\p{Alphabetic}|\\p{Number}|\\p{Nonspacing_Mark})+', 'ug'),
}),
vscode.languages.registerDocumentSymbolProvider(selector, symbolProvider),
vscode.languages.registerDocumentLinkProvider(selector, new LinkProvider()),

View File

@@ -25,7 +25,7 @@ interface WebviewMessage {
interface CacheImageSizesMessage extends WebviewMessage {
readonly type: 'cacheImageSizes';
readonly body: { id: string, width: number, height: number }[];
readonly body: { id: string, width: number, height: number; }[];
}
interface RevealLineMessage extends WebviewMessage {
@@ -43,10 +43,9 @@ interface DidClickMessage extends WebviewMessage {
}
interface ClickLinkMessage extends WebviewMessage {
readonly type: 'clickLink';
readonly type: 'openLink';
readonly body: {
readonly path: string;
readonly fragment?: string;
readonly href: string;
};
}
@@ -88,7 +87,7 @@ export class MarkdownPreview extends Disposable {
private forceUpdate = false;
private isScrolling = false;
private _disposed: boolean = false;
private imageInfo: { id: string, width: number, height: number }[] = [];
private imageInfo: { id: string, width: number, height: number; }[] = [];
private scrollToFragment: string | undefined;
public static async revive(
@@ -202,8 +201,8 @@ export class MarkdownPreview extends Disposable {
this.onDidClickPreview(e.body.line);
break;
case 'clickLink':
this.onDidClickPreviewLink(e.body.path, e.body.fragment);
case 'openLink':
this.onDidClickPreviewLink(e.body.href);
break;
case 'showPreviewSecuritySelector':
@@ -284,17 +283,19 @@ export class MarkdownPreview extends Disposable {
super.dispose();
}
public update(resource: vscode.Uri) {
const editor = vscode.window.activeTextEditor;
public update(resource: vscode.Uri, isRefresh = true) {
// Reposition scroll preview, position scroll to the top if active text editor
// doesn't corresponds with preview
const editor = vscode.window.activeTextEditor;
if (editor) {
if (!isRefresh || this._previewConfigurations.loadAndCacheConfiguration(this._resource).scrollEditorWithPreview) {
if (editor.document.uri.fsPath === resource.fsPath) {
this.line = getVisibleLine(editor);
} else {
this.line = 0;
}
}
}
// If we have changed resources, cancel any pending updates
@@ -320,7 +321,7 @@ export class MarkdownPreview extends Disposable {
public refresh() {
this.forceUpdate = true;
this.update(this._resource);
this.update(this._resource, true);
}
public updateConfiguration() {
@@ -484,6 +485,12 @@ export class MarkdownPreview extends Disposable {
private onDidScrollPreview(line: number) {
this.line = line;
const config = this._previewConfigurations.loadAndCacheConfiguration(this._resource);
if (!config.scrollEditorWithPreview) {
return;
}
for (const editor of vscode.window.visibleTextEditors) {
if (!this.isPreviewOf(editor.document.uri)) {
continue;
@@ -528,12 +535,19 @@ export class MarkdownPreview extends Disposable {
this.editor.webview.html = html;
}
private async onDidClickPreviewLink(path: string, fragment: string | undefined) {
this.scrollToFragment = undefined;
private async onDidClickPreviewLink(href: string) {
let [hrefPath, fragment] = decodeURIComponent(href).split('#');
// We perviously already resolve absolute paths.
// Now make sure we handle relative file paths
if (hrefPath[0] !== '/') {
hrefPath = path.join(path.dirname(this.resource.path), hrefPath);
}
const config = vscode.workspace.getConfiguration('markdown', this.resource);
const openLinks = config.get<string>('preview.openMarkdownLinks', 'inPreview');
if (openLinks === 'inPreview') {
const markdownLink = await resolveLinkToMarkdownFile(path);
const markdownLink = await resolveLinkToMarkdownFile(hrefPath);
if (markdownLink) {
if (fragment) {
this.scrollToFragment = fragment;
@@ -543,10 +557,10 @@ export class MarkdownPreview extends Disposable {
}
}
vscode.commands.executeCommand('_markdown.openDocumentLink', { path, fragment, fromResource: this.resource });
vscode.commands.executeCommand('_markdown.openDocumentLink', { path: hrefPath, fragment, fromResource: this.resource });
}
private async onCacheImageSizes(imageInfo: { id: string, width: number, height: number }[]) {
private async onCacheImageSizes(imageInfo: { id: string, width: number, height: number; }[]) {
this.imageInfo = imageInfo;
}
}

View File

@@ -4,13 +4,13 @@
*--------------------------------------------------------------------------------------------*/
import * as crypto from 'crypto';
import { MarkdownIt, Token } from 'markdown-it';
import * as path from 'path';
import { MarkdownIt, Token } from 'markdown-it';
import * as vscode from 'vscode';
import { MarkdownContributionProvider as MarkdownContributionProvider } from './markdownExtensions';
import { Slugifier } from './slugify';
import { SkinnyTextDocument } from './tableOfContentsProvider';
import { getUriForLinkWithKnownExternalScheme } from './util/links';
import { Schemes, isOfScheme } from './util/links';
const UNICODE_NEWLINE_REGEX = /\u2028|\u2029/g;
@@ -105,10 +105,10 @@ export class MarkdownEngine {
this.addImageStabilizer(md);
this.addFencedRenderer(md);
this.addLinkNormalizer(md);
this.addLinkValidator(md);
this.addNamedHeaders(md);
this.addLinkRenderer(md);
return md;
});
}
@@ -150,6 +150,7 @@ export class MarkdownEngine {
public async render(input: SkinnyTextDocument | string): Promise<string> {
const config = this.getConfig(typeof input === 'string' ? undefined : input.uri);
const engine = await this.getEngine(config);
const tokens = typeof input === 'string'
? this.tokenizeString(input, engine)
: this.tokenizeDocument(input, config, engine);
@@ -233,36 +234,28 @@ export class MarkdownEngine {
const normalizeLink = md.normalizeLink;
md.normalizeLink = (link: string) => {
try {
const externalSchemeUri = getUriForLinkWithKnownExternalScheme(link);
if (externalSchemeUri) {
// set true to skip encoding
return normalizeLink(externalSchemeUri.toString(true));
}
// If original link doesn't look like a url with a scheme, assume it must be a link to a file in workspace
if (!/^[a-z\-]+:/i.test(link)) {
// Use a fake scheme for parsing
let uri = vscode.Uri.parse('markdown-link:' + link);
// Assume it must be an relative or absolute file path
// Use a fake scheme to avoid parse warnings
let uri = vscode.Uri.parse(`vscode-resource:${link}`);
if (uri.path) {
// Assume it must be a file
const fragment = uri.fragment;
// Relative paths should be resolved correctly inside the preview but we need to
// handle absolute paths specially (for images) to resolve them relative to the workspace root
if (uri.path[0] === '/') {
const root = vscode.workspace.getWorkspaceFolder(this.currentDocument!);
if (root) {
uri = vscode.Uri.file(path.join(root.uri.fsPath, uri.path));
}
} else {
uri = vscode.Uri.file(path.join(path.dirname(this.currentDocument!.path), uri.path));
}
if (fragment) {
uri = uri.with({
fragment: this.slugifier.fromHeading(fragment).value
path: path.join(root.uri.fsPath, uri.path),
});
}
return normalizeLink(uri.with({ scheme: 'vscode-resource' }).toString(true));
} else if (!uri.path && uri.fragment) {
return `#${this.slugifier.fromHeading(uri.fragment).value}`;
}
if (uri.fragment) {
uri = uri.with({
fragment: this.slugifier.fromHeading(uri.fragment).value
});
}
return normalizeLink(uri.toString(true).replace(/^markdown-link:/, ''));
}
} catch (e) {
// noop
@@ -275,7 +268,7 @@ export class MarkdownEngine {
const validateLink = md.validateLink;
md.validateLink = (link: string) => {
// support file:// links
return validateLink(link) || link.startsWith('file:') || /^data:image\/.*?;/.test(link);
return validateLink(link) || isOfScheme(Schemes.file, link) || /^data:image\/.*?;/.test(link);
};
}
@@ -303,6 +296,22 @@ export class MarkdownEngine {
}
};
}
private addLinkRenderer(md: any): void {
const old_render = md.renderer.rules.link_open || ((tokens: any, idx: number, options: any, _env: any, self: any) => {
return self.renderToken(tokens, idx, options);
});
md.renderer.rules.link_open = (tokens: any, idx: number, options: any, env: any, self: any) => {
const token = tokens[idx];
const hrefIndex = token.attrIndex('href');
if (hrefIndex >= 0) {
const href = token.attrs[hrefIndex][1];
token.attrPush(['data-href', href]);
}
return old_render(tokens, idx, options, env, self);
};
}
}
async function getMarkdownOptions(md: () => MarkdownIt) {
@@ -310,16 +319,7 @@ async function getMarkdownOptions(md: () => MarkdownIt) {
return {
html: true,
highlight: (str: string, lang?: string) => {
// Workaround for highlight not supporting tsx: https://github.com/isagalaev/highlight.js/issues/1155
if (lang && ['tsx', 'typescriptreact'].includes(lang.toLocaleLowerCase())) {
lang = 'jsx';
}
if (lang && lang.toLocaleLowerCase() === 'json5') {
lang = 'json';
}
if (lang && ['c#', 'csharp'].includes(lang.toLocaleLowerCase())) {
lang = 'cs';
}
lang = normalizeHighlightLang(lang);
if (lang && hljs.getLanguage(lang)) {
try {
return `<div>${hljs.highlight(lang, str, true).value}</div>`;
@@ -330,3 +330,24 @@ async function getMarkdownOptions(md: () => MarkdownIt) {
}
};
}
function normalizeHighlightLang(lang: string | undefined) {
switch (lang && lang.toLowerCase()) {
case 'tsx':
case 'typescriptreact':
// Workaround for highlight not supporting tsx: https://github.com/isagalaev/highlight.js/issues/1155
return 'jsx';
case 'json5':
case 'jsonc':
return 'json';
case 'c#':
case 'csharp':
return 'cs';
default:
return lang;
}
}

View File

@@ -5,14 +5,30 @@
import * as vscode from 'vscode';
const knownSchemes = ['http:', 'https:', 'file:', 'mailto:', 'data:', `${vscode.env.uriScheme}:`, 'vscode:', 'vscode-insiders:', 'vscode-resource:'];
export const Schemes = {
http: 'http:',
https: 'https:',
file: 'file:',
mailto: 'mailto:',
data: 'data:',
vscode: 'vscode:',
'vscode-insiders': 'vscode-insiders:',
'vscode-resource': 'vscode-resource',
};
export function getUriForLinkWithKnownExternalScheme(
link: string,
): vscode.Uri | undefined {
if (knownSchemes.some(knownScheme => link.toLowerCase().startsWith(knownScheme))) {
const knownSchemes = [
...Object.values(Schemes),
`${vscode.env.uriScheme}:`
];
export function getUriForLinkWithKnownExternalScheme(link: string): vscode.Uri | undefined {
if (knownSchemes.some(knownScheme => isOfScheme(knownScheme, link))) {
return vscode.Uri.parse(link);
}
return undefined;
}
export function isOfScheme(scheme: string, link: string): boolean {
return link.toLowerCase().startsWith(scheme);
}

View File

@@ -1973,10 +1973,10 @@ enhanced-resolve@^4.0.0:
memory-fs "^0.4.0"
tapable "^1.0.0"
entities@~1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.1.tgz#6e5c2d0a5621b5dadaecef80b90edfb5cd7772f0"
integrity sha1-blwtClYhtdra7O+AuQ7ftc13cvA=
entities@~2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/entities/-/entities-2.0.0.tgz#68d6084cab1b079767540d80e56a39b423e4abf4"
integrity sha512-D9f7V0JSRwIxlRI2mjMqufDrRDnx8p+eEOz7aUM9SuvF8gsBzra0/6tbjl1m8eQHrZlYj6PxqE00hZ1SAIKPLw==
errno@^0.1.3, errno@~0.1.7:
version "0.1.7"
@@ -2933,10 +2933,10 @@ he@1.1.1:
resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd"
integrity sha1-k0EP0hsAlzUVH4howvJx80J+I/0=
highlight.js@9.15.8:
version "9.15.8"
resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.15.8.tgz#f344fda123f36f1a65490e932cf90569e4999971"
integrity sha512-RrapkKQWwE+wKdF73VsOa2RQdIoO3mxwJ4P8mhbI6KYJUraUHRKM5w5zQQKXNk0xNL4UVRdulV9SBJcmzJNzVA==
highlight.js@9.15.10:
version "9.15.10"
resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.15.10.tgz#7b18ed75c90348c045eef9ed08ca1319a2219ad2"
integrity sha512-RoV7OkQm0T3os3Dd2VHLNMoaoDVx77Wygln3n9l5YV172XonWG6rgQD3XnF/BuFFZw9A0TJgmMSO8FEWQgvcXw==
hmac-drbg@^1.0.0:
version "1.0.1"
@@ -3900,13 +3900,13 @@ markdown-it-front-matter@^0.1.2:
resolved "https://registry.yarnpkg.com/markdown-it-front-matter/-/markdown-it-front-matter-0.1.2.tgz#e50bf56e77e6a4f5ac4ffa894d4d45ccd9896b20"
integrity sha1-5Qv1bnfmpPWsT/qJTU1FzNmJayA=
markdown-it@^9.1.0:
version "9.1.0"
resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-9.1.0.tgz#df9601c168568704d554b1fff9af0c5b561168d9"
integrity sha512-xHKG4C8iPriyfu/jc2hsCC045fKrMQ0VexX2F1FGYiRxDxqMB2aAhF8WauJ3fltn2kb90moGBkiiEdooGIg55w==
markdown-it@^10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-10.0.0.tgz#abfc64f141b1722d663402044e43927f1f50a8dc"
integrity sha512-YWOP1j7UbDNz+TumYP1kpwnP0aEa711cJjrAQrzd0UXlbJfc5aAq0F/PZHjiioqDC1NKgvIMX+o+9Bk7yuM2dg==
dependencies:
argparse "^1.0.7"
entities "~1.1.1"
entities "~2.0.0"
linkify-it "^2.0.0"
mdurl "^1.0.1"
uc.micro "^1.0.5"

View File

@@ -3,14 +3,12 @@
"tokenColors": [
{
"settings": {
"background": "#000c18",
"foreground": "#6688cc"
}
},
{
"scope": ["meta.embedded", "source.groovy.embedded"],
"settings": {
"background": "#000c18",
"foreground": "#6688cc"
}
},
@@ -173,7 +171,6 @@
"name": "Invalid",
"scope": "invalid",
"settings": {
"background": "#F92672",
"fontStyle": "",
"foreground": "#F8F8F0"
}
@@ -182,7 +179,6 @@
"name": "Invalid deprecated",
"scope": "invalid.deprecated",
"settings": {
"background": "#AE81FF",
"foreground": "#F8F8F0"
}
},
@@ -193,7 +189,6 @@
"meta.diff.header"
],
"settings": {
"background": "#b58900",
"fontStyle": "italic",
"foreground": "#E0EDDD"
}
@@ -202,7 +197,6 @@
"name": "diff: deleted",
"scope": "markup.deleted",
"settings": {
"background": "#eee8d5",
"fontStyle": "",
"foreground": "#dc322f"
}
@@ -211,7 +205,6 @@
"name": "diff: changed",
"scope": "markup.changed",
"settings": {
"background": "#eee8d5",
"fontStyle": "",
"foreground": "#cb4b16"
}
@@ -220,7 +213,6 @@
"name": "diff: inserted",
"scope": "markup.inserted",
"settings": {
"background": "#eee8d5",
"foreground": "#219186"
}
},
@@ -378,7 +370,6 @@
"tab.border": "#2b2b4a",
// "tab.activeBackground": "",
"tab.inactiveBackground": "#10192c",
"tab.modifiedBorder": "#0072bf",
// "tab.activeForeground": "",
// "tab.inactiveForeground": "",

View File

@@ -23,7 +23,6 @@
"editorGroupHeader.tabsBackground": "#131510",
"editorLineNumber.activeForeground": "#adadad",
"tab.inactiveBackground": "#131510",
"tab.modifiedBorder": "#cd9731",
"titleBar.activeBackground": "#423523",
"statusBar.background": "#423523",
"statusBar.debuggingBackground": "#423523",
@@ -55,14 +54,12 @@
"tokenColors": [
{
"settings": {
"background": "#221a0f",
"foreground": "#d3af86"
}
},
{
"scope": ["meta.embedded", "source.groovy.embedded"],
"settings": {
"background": "#221a0f",
"foreground": "#d3af86"
}
},
@@ -335,7 +332,6 @@
"name": "Separator",
"scope": "meta.separator",
"settings": {
"background": "#84613d",
"foreground": "#d3af86"
}
},

View File

@@ -24,7 +24,6 @@
"editorGroupHeader.tabsBackground": "#282828",
"tab.inactiveBackground": "#404040",
"tab.border": "#303030",
"tab.modifiedBorder": "#6796e6",
"tab.inactiveForeground": "#d8d8d8",
"peekView.border": "#3655b5",
"panelTitle.activeForeground": "#ffffff",
@@ -48,24 +47,15 @@
"tokenColors": [
{
"settings": {
"background": "#1e1e1e",
"foreground": "#C5C8C6"
}
},
{
"name": "By uonick",
"settings": {
"background": "#202025ff",
"foreground": "#c5c8c6ff"
}
},
{
"scope": [
"meta.embedded",
"source.groovy.embedded"
],
"settings": {
"background": "#1e1e1e",
"foreground": "#C5C8C6"
}
},
@@ -115,7 +105,6 @@
"settings": {
"fontStyle": "",
"foreground": "#8080FF",
"background": "#1e1e1e"
}
},
{
@@ -148,7 +137,6 @@
"settings": {
"fontStyle": "",
"foreground": "#9B0000",
"background": "#1E1E1E"
}
},
{
@@ -482,7 +470,6 @@
"name": "diff: header",
"scope": "meta.diff, meta.diff.header",
"settings": {
"background": "#b58900",
"fontStyle": "italic",
"foreground": "#E0EDDD"
}
@@ -491,7 +478,6 @@
"name": "diff: deleted",
"scope": "markup.deleted",
"settings": {
"background": "#eee8d5",
"fontStyle": "",
"foreground": "#dc322f"
}
@@ -500,7 +486,6 @@
"name": "diff: changed",
"scope": "markup.changed",
"settings": {
"background": "#eee8d5",
"fontStyle": "",
"foreground": "#cb4b16"
}
@@ -509,7 +494,6 @@
"name": "diff: inserted",
"scope": "markup.inserted",
"settings": {
"background": "#eee8d5",
"foreground": "#219186"
}
},

View File

@@ -36,7 +36,6 @@
"editorGroup.dropBackground": "#41433980",
"tab.inactiveBackground": "#34352f",
"tab.border": "#1e1f1c",
"tab.modifiedBorder": "#007acc",
"tab.inactiveForeground": "#ccccc7", // needs to be bright so it's readable when another editor group is focused
"widget.shadow": "#000000",
"progressBar.background": "#75715E",
@@ -65,8 +64,8 @@
"focusBorder": "#75715E",
"editorWidget.background": "#1e1f1c",
"debugToolBar.background": "#1e1f1c",
"diffEditor.insertedTextBackground": "#66852880", // middle of #272822 and #a6e22e
"diffEditor.removedTextBackground": "#90274A80", // middle of #272822 and #f92672
"diffEditor.insertedTextBackground": "#4b661680", // middle of #272822 and #a6e22e
"diffEditor.removedTextBackground": "#90274A70", // middle of #272822 and #f92672
"inputValidation.errorBackground": "#90274A", // middle of #272822 and #f92672
"inputValidation.errorBorder": "#f92672",
"inputValidation.warningBackground": "#848528", // middle of #272822 and #e2e22e
@@ -105,7 +104,6 @@
"tokenColors": [
{
"settings": {
"background": "#272822",
"foreground": "#F8F8F2"
}
},
@@ -115,7 +113,6 @@
"source.groovy.embedded"
],
"settings": {
"background": "#272822",
"foreground": "#F8F8F2"
}
},
@@ -123,7 +120,7 @@
"name": "Comment",
"scope": "comment",
"settings": {
"foreground": "#75715E"
"foreground": "#88846f"
}
},
{
@@ -287,7 +284,6 @@
"name": "Invalid",
"scope": "invalid",
"settings": {
"background": "#F92672",
"fontStyle": "",
"foreground": "#F8F8F0"
}
@@ -296,7 +292,6 @@
"name": "Invalid deprecated",
"scope": "invalid.deprecated",
"settings": {
"background": "#AE81FF",
"foreground": "#F8F8F0"
}
},

View File

@@ -3,7 +3,6 @@
"tokenColors": [
{
"settings": {
"background": "#F5F5F5",
"foreground": "#333333"
}
},
@@ -13,7 +12,6 @@
"source.groovy.embedded"
],
"settings": {
"background": "#F5F5F5",
"foreground": "#333333"
}
},
@@ -47,18 +45,10 @@
"foreground": "#448C27"
}
},
{
"name": "Invalid - Deprecated",
"scope": "invalid.deprecated",
"settings": {
"background": "#96000014"
}
},
{
"name": "Invalid - Illegal",
"scope": "invalid.illegal",
"settings": {
"background": "#96000014",
"foreground": "#660000"
}
},
@@ -195,20 +185,6 @@
"foreground": "#777777"
}
},
{
"name": "Embedded Source",
"scope": [
"string source",
"text source"
],
"settings": {
"background": "#EAEBE6"
}
},
{
"name": "-----------------------------------",
"settings": {}
},
{
"name": "HTML: Doctype Declaration",
"scope": [
@@ -261,10 +237,6 @@
"foreground": "#9C5D27"
}
},
{
"name": "-----------------------------------",
"settings": {}
},
{
"name": "CSS: Selectors",
"scope": [
@@ -305,15 +277,10 @@
"fontStyle": "bold"
}
},
{
"name": "-----------------------------------",
"settings": {}
},
{
"name": "Markup: Changed",
"scope": "markup.changed",
"settings": {
"background": "#FFFFDD",
"foreground": "#000000"
}
},
@@ -321,7 +288,6 @@
"name": "Markup: Deletion",
"scope": "markup.deleted",
"settings": {
"background": "#FFDDDD",
"foreground": "#000000"
}
},
@@ -336,7 +302,6 @@
"name": "Markup: Error",
"scope": "markup.error",
"settings": {
"background": "#96000014",
"foreground": "#660000"
}
},
@@ -344,7 +309,6 @@
"name": "Markup: Insertion",
"scope": "markup.inserted",
"settings": {
"background": "#DDFFDD",
"foreground": "#000000"
}
},
@@ -432,10 +396,6 @@
"foreground": "#9C5D27"
}
},
{
"name": "-----------------------------------",
"settings": {}
},
{
"name": "Extra: Diff Range",
"scope": [
@@ -444,7 +404,6 @@
"meta.separator"
],
"settings": {
"background": "#DDDDFF",
"foreground": "#434343"
}
},
@@ -452,7 +411,6 @@
"name": "Extra: Diff From",
"scope": "meta.diff.header.from-file",
"settings": {
"background": "#FFDDDD",
"foreground": "#434343"
}
},
@@ -460,7 +418,6 @@
"name": "Extra: Diff To",
"scope": "meta.diff.header.to-file",
"settings": {
"background": "#DDFFDD",
"foreground": "#434343"
}
},
@@ -500,7 +457,6 @@
"editorLineNumber.activeForeground": "#9769dc",
"editor.selectionBackground": "#C9D0D9",
"minimap.selectionHighlight": "#C9D0D9",
"tab.modifiedBorder": "#f1897f",
"panel.background": "#F5F5F5",
"sideBar.background": "#F2F2F2",
"sideBarSectionHeader.background": "#ede8ef",

View File

@@ -5,7 +5,6 @@
"activityBar.background": "#580000",
"tab.inactiveBackground": "#300a0a",
"tab.activeBackground": "#490000",
"tab.modifiedBorder": "#db7e58",
"sideBar.background": "#330000",
"statusBar.background": "#700000",
"statusBar.noFolderBackground": "#700000",
@@ -62,12 +61,7 @@
"tokenColors": [
{
"settings": {
"background": "#390000",
"caret": "#970000",
"foreground": "#F8F8F8",
"invisibles": "#c10000",
"lineHighlight": "#0000004A",
"selection": "#750000"
}
},
{
@@ -76,7 +70,6 @@
"source.groovy.embedded"
],
"settings": {
"background": "#390000",
"foreground": "#F8F8F8"
}
},
@@ -148,24 +141,9 @@
"name": "Invalid",
"scope": "invalid",
"settings": {
"background": "#fd6209ff",
"foreground": "#ffffffff"
}
},
{
"name": "Embedded Source",
"scope": "text source",
"settings": {
"background": "#b0b3ba14"
}
},
{
"name": "Embedded Source (Bright)",
"scope": "text.html.ruby source",
"settings": {
"background": "#b1b3ba21"
}
},
{
"name": "Entity inherited-class",
"scope": "entity.other.inherited-class",
@@ -323,7 +301,6 @@
"meta.diff.header"
],
"settings": {
"background": "#0b2f20ff",
"fontStyle": "italic",
"foreground": "#f8f8f8ff"
}
@@ -332,7 +309,6 @@
"name": "diff.deleted",
"scope": "markup.deleted",
"settings": {
"background": "#fedcddff",
"foreground": "#ec9799ff"
}
},
@@ -340,7 +316,6 @@
"name": "diff.changed",
"scope": "markup.changed",
"settings": {
"background": "#c4b14aff",
"foreground": "#f8f8f8ff"
}
},
@@ -348,7 +323,6 @@
"name": "diff.inserted",
"scope": "markup.inserted",
"settings": {
"background": "#9bf199ff",
"foreground": "#41a83eff"
}
},

View File

@@ -3,14 +3,12 @@
"tokenColors": [
{
"settings": {
"background": "#002B36",
"foreground": "#93A1A1"
}
},
{
"scope": ["meta.embedded", "source.groovy.embedded"],
"settings": {
"background": "#002B36",
"foreground": "#93A1A1"
}
},
@@ -221,7 +219,6 @@
"meta.diff.header"
],
"settings": {
"background": "#b58900",
"fontStyle": "italic",
"foreground": "#E0EDDD"
}
@@ -230,7 +227,6 @@
"name": "diff: deleted",
"scope": "markup.deleted",
"settings": {
"background": "#eee8d5",
"fontStyle": "",
"foreground": "#dc322f"
}
@@ -239,7 +235,6 @@
"name": "diff: changed",
"scope": "markup.changed",
"settings": {
"background": "#eee8d5",
"fontStyle": "",
"foreground": "#cb4b16"
}
@@ -248,7 +243,6 @@
"name": "diff: inserted",
"scope": "markup.inserted",
"settings": {
"background": "#eee8d5",
"foreground": "#219186"
}
},
@@ -425,7 +419,6 @@
"tab.inactiveForeground": "#93A1A1",
"tab.inactiveBackground": "#004052",
"tab.border": "#003847",
"tab.modifiedBorder": "#268bd2",
// Workbench: Activity Bar
"activityBar.background": "#003847",

View File

@@ -3,14 +3,12 @@
"tokenColors": [
{
"settings": {
"background": "#FDF6E3",
"foreground": "#657B83"
}
},
{
"scope": ["meta.embedded", "source.groovy.embedded"],
"settings": {
"background": "#FDF6E3",
"foreground": "#657B83"
}
},

View File

@@ -18,16 +18,18 @@
"monaco-editor-test": "mocha --only-monaco-editor",
"precommit": "node build/gulpfile.hygiene.js",
"gulp": "gulp --max_old_space_size=8192",
"electron": "node build/lib/electron",
"7z": "7z",
"update-grammars": "node build/npm/update-all-grammars.js",
"update-localization-extension": "node build/npm/update-localization-extension.js",
"smoketest": "cd test/smoke && node test/index.js",
"monaco-compile-check": "tsc -p src/tsconfig.monaco.json --noEmit",
"tslint": "node node_modules/tslint/bin/tslint -c tslint-gci.json -p src/tsconfig.json",
"strict-null-check": "tsc -p src/tsconfig.strictNullChecks.json",
"strict-null-check-watch": "tsc -p src/tsconfig.strictNullChecks.json --watch",
"strict-null-check": "node node_modules/typescript/bin/tsc -p src/tsconfig.strictNullChecks.json",
"strict-null-check-watch": "node node_modules/typescript/bin/tsc -p src/tsconfig.strictNullChecks.json --watch",
"strict-initialization-watch": "tsc --watch -p src/tsconfig.json --noEmit --strictPropertyInitialization",
"update-distro": "node build/npm/update-distro.js"
"update-distro": "node build/npm/update-distro.js",
"web": "node scripts/code-web.js"
},
"dependencies": {
"@angular/animations": "~4.1.3",
@@ -38,13 +40,12 @@
"@angular/platform-browser": "~4.1.3",
"@angular/platform-browser-dynamic": "~4.1.3",
"@angular/router": "~4.1.3",
"@microsoft/applicationinsights-web": "^2.1.1",
"angular2-grid": "2.0.6",
"angular2-slickgrid": "github:Microsoft/angular2-slickgrid#1.4.6",
"ansi_up": "^3.0.0",
"applicationinsights": "1.0.8",
"chart.js": "^2.6.0",
"chokidar": "3.1.0",
"chokidar": "3.2.2",
"graceful-fs": "4.1.11",
"html-query-plan": "git://github.com/anthonydresser/html-query-plan.git#2.6",
"http-proxy-agent": "^2.1.0",
@@ -75,9 +76,9 @@
"vscode-ripgrep": "^1.5.7",
"vscode-sqlite3": "4.0.8",
"vscode-textmate": "^4.2.2",
"xterm": "4.1.0-beta8",
"xterm-addon-search": "0.2.0",
"xterm-addon-web-links": "0.2.0",
"xterm": "^4.2.0-beta20",
"xterm-addon-search": "0.3.0-beta5",
"xterm-addon-web-links": "0.2.1",
"yauzl": "^2.9.2",
"yazl": "^2.4.3",
"zone.js": "^0.8.4"
@@ -126,7 +127,7 @@
"gulp-rename": "^1.2.0",
"gulp-replace": "^0.5.4",
"gulp-shell": "^0.6.5",
"gulp-tsb": "4.0.4",
"gulp-tsb": "4.0.5",
"gulp-tslint": "^8.1.3",
"gulp-untar": "^0.0.7",
"gulp-vinyl-zip": "^2.1.2",
@@ -161,7 +162,7 @@
"tslint": "^5.16.0",
"tslint-microsoft-contrib": "^6.0.0",
"typemoq": "^0.3.2",
"typescript": "3.6",
"typescript": "3.7.0-dev.20191017",
"typescript-formatter": "7.1.0",
"vinyl": "^2.0.0",
"vinyl-fs": "^3.0.0",

View File

@@ -1,3 +1,3 @@
disturl "http://nodejs.org/dist"
target "10.11.0"
target "12.4.0"
runtime "node"

View File

@@ -2,9 +2,8 @@
"name": "vscode-reh",
"version": "0.0.0",
"dependencies": {
"@microsoft/applicationinsights-web": "^2.1.1",
"applicationinsights": "1.0.8",
"chokidar": "3.1.0",
"chokidar": "3.2.2",
"cookie": "^0.4.0",
"graceful-fs": "4.1.11",
"http-proxy-agent": "^2.1.0",
@@ -21,9 +20,9 @@
"vscode-proxy-agent": "0.4.0",
"vscode-ripgrep": "^1.5.7",
"vscode-textmate": "^4.2.2",
"xterm": "4.1.0-beta8",
"xterm-addon-search": "0.2.0",
"xterm-addon-web-links": "0.2.0",
"xterm": "^4.2.0-beta20",
"xterm-addon-search": "0.3.0-beta5",
"xterm-addon-web-links": "0.2.1",
"yauzl": "^2.9.2",
"yazl": "^2.4.3"
},

View File

@@ -2,12 +2,11 @@
"name": "vscode-web",
"version": "0.0.0",
"dependencies": {
"@microsoft/applicationinsights-web": "^2.1.1",
"onigasm-umd": "^2.2.2",
"semver-umd": "^5.5.3",
"vscode-textmate": "^4.2.2",
"xterm": "4.1.0-beta8",
"xterm-addon-search": "0.2.0",
"xterm-addon-web-links": "0.2.0"
"xterm": "^4.2.0-beta20",
"xterm-addon-search": "0.3.0-beta5",
"xterm-addon-web-links": "0.2.1"
}
}

View File

@@ -2,69 +2,6 @@
# yarn lockfile v1
"@microsoft/applicationinsights-analytics-js@2.1.1":
version "2.1.1"
resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-analytics-js/-/applicationinsights-analytics-js-2.1.1.tgz#6d09c1915f808026e2d45165d04802f09affed59"
integrity sha512-VKIutoFKY99CyKwxLUuj6Vnq14/QwXo9/QSQDpYnHEjo+uKn7QmLsHqWw0K9uYNfNAXt4BZimX/zDg6jZtzeXg==
dependencies:
"@microsoft/applicationinsights-common" "2.1.1"
"@microsoft/applicationinsights-core-js" "2.1.1"
tslib "^1.9.3"
"@microsoft/applicationinsights-channel-js@2.1.1":
version "2.1.1"
resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-channel-js/-/applicationinsights-channel-js-2.1.1.tgz#e205eddd93e49d17d9e0711a612b4bfc9810888f"
integrity sha512-fYr9IAqtaEr9AmaPaL3SLQVT3t3GQzl+n74gpNKyAVakDIm0nYQ/bimjdcAhJMDf1VGNSPg/xICneyuZg7Wxlg==
dependencies:
"@microsoft/applicationinsights-common" "2.1.1"
"@microsoft/applicationinsights-core-js" "2.1.1"
tslib "^1.9.3"
"@microsoft/applicationinsights-common@2.1.1":
version "2.1.1"
resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-common/-/applicationinsights-common-2.1.1.tgz#27e6074584a7a3a8ca3f11f7ff2b7ff0f395bf2d"
integrity sha512-2hkS1Ia1FmAjCuYZ5JlG20/WgObqdsKtmK5YALAFGHIB4KSQ/Za1qazS+7GsG+E0F9UJivNWL1geUIcNqg5Qjg==
dependencies:
"@microsoft/applicationinsights-core-js" "2.1.1"
tslib "^1.9.3"
"@microsoft/applicationinsights-core-js@2.1.1":
version "2.1.1"
resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-2.1.1.tgz#30fb6a519cc1c6119c419c4811ce72c260217d9e"
integrity sha512-4t4wf6SKqIcWEQDPg/uOhm+BxtHhu/AFreyEoYZmMfcxzAu33h1FtTQRtxBNbYH1+thiNZCh80yUpnT7d9Hrlw==
dependencies:
tslib "^1.9.3"
"@microsoft/applicationinsights-dependencies-js@2.1.1":
version "2.1.1"
resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-dependencies-js/-/applicationinsights-dependencies-js-2.1.1.tgz#8154c3efcb24617d015d0bce7c2cc47797a8d3c4"
integrity sha512-yhb4EToBp+aI+qLo0h5NDNtoo3sDFV60uyIOK843YjzXqVotcXX/lRShlghTkJtYH09QhrdzDjViUHnD4sMFSQ==
dependencies:
"@microsoft/applicationinsights-common" "2.1.1"
"@microsoft/applicationinsights-core-js" "2.1.1"
tslib "^1.9.3"
"@microsoft/applicationinsights-properties-js@2.1.1":
version "2.1.1"
resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-properties-js/-/applicationinsights-properties-js-2.1.1.tgz#ca34232766eb16167b5d87693e2ae5d94f2a1559"
integrity sha512-8l+/ppw6xKTam2RL4EHZ52Lcf217olw81j6kyBNKtIcGwSnLNHrFwEeF3vBWIteG2JKzlg1GhGjrkB3oxXsV2g==
dependencies:
"@microsoft/applicationinsights-common" "2.1.1"
"@microsoft/applicationinsights-core-js" "2.1.1"
tslib "^1.9.3"
"@microsoft/applicationinsights-web@^2.1.1":
version "2.1.1"
resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-web/-/applicationinsights-web-2.1.1.tgz#1a44eddda7c244b88d9eb052dab6c855682e4f05"
integrity sha512-crvhCkNsNxkFuPWmttyWNSAA96D5FxBtKS6UA9MV9f9XHevTfchf/E3AuU9JZcsXufWMQLwLrUQ9ZiA1QJ0EWA==
dependencies:
"@microsoft/applicationinsights-analytics-js" "2.1.1"
"@microsoft/applicationinsights-channel-js" "2.1.1"
"@microsoft/applicationinsights-common" "2.1.1"
"@microsoft/applicationinsights-core-js" "2.1.1"
"@microsoft/applicationinsights-dependencies-js" "2.1.1"
"@microsoft/applicationinsights-properties-js" "2.1.1"
nan@^2.14.0:
version "2.14.0"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c"
@@ -87,11 +24,6 @@ semver-umd@^5.5.3:
resolved "https://registry.yarnpkg.com/semver-umd/-/semver-umd-5.5.3.tgz#b64d7a2d4f5a717b369d56e31940a38e47e34d1e"
integrity sha512-HOnQrn2iKnVe/xlqCTzMXQdvSz3rPbD0DmQXYuQ+oK1dpptGFfPghonQrx5JHl2O7EJwDqtQnjhE7ME23q6ngw==
tslib@^1.9.3:
version "1.10.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a"
integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==
vscode-textmate@^4.2.2:
version "4.2.2"
resolved "https://registry.yarnpkg.com/vscode-textmate/-/vscode-textmate-4.2.2.tgz#0b4dabc69a6fba79a065cb6b615f66eac07c8f4c"
@@ -99,17 +31,17 @@ vscode-textmate@^4.2.2:
dependencies:
oniguruma "^7.2.0"
xterm-addon-search@0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/xterm-addon-search/-/xterm-addon-search-0.2.0.tgz#46659c7c33f9fc268ad3e7e6c5824bb2fdb65852"
integrity sha512-C/v2VvFn3hb1qUgjJPo7LxzxNCLBgNJv8n6v/bH2NqPz32/PNUF+IHu0SFf1TaIH+pydUpKXCtob5a/UyZg/+Q==
xterm-addon-search@0.3.0-beta5:
version "0.3.0-beta5"
resolved "https://registry.yarnpkg.com/xterm-addon-search/-/xterm-addon-search-0.3.0-beta5.tgz#fd53d33a77a0235018479c712be8c12f7c0d083a"
integrity sha512-3GkGc4hST35/4hzgnQPLLvQ29WH7MkZ0mUrBE/Vm1IQum7TnMvWPTkGemwM+wAl4tdBmynNccHJlFeQzaQtVUg==
xterm-addon-web-links@0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/xterm-addon-web-links/-/xterm-addon-web-links-0.2.0.tgz#b408a0be46211d8d4a0bb5e701d8f3c2bd07d473"
integrity sha512-dq81c4Pzli2PgKVBgY2REte9sCVibR3df8AP3SEvCTM9uYFnUFxtxzMTplPnc7+rXabVhFdbU6x+rstIk8HNQg==
xterm-addon-web-links@0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/xterm-addon-web-links/-/xterm-addon-web-links-0.2.1.tgz#6d1f2ce613e09870badf17615e7a1170a31542b2"
integrity sha512-2KnHtiq0IG7hfwv3jw2/jQeH1RBk2d5CH4zvgwQe00rLofSJqSfgnJ7gwowxxpGHrpbPr6Lv4AmH/joaNw2+HQ==
xterm@4.1.0-beta8:
version "4.1.0-beta8"
resolved "https://registry.yarnpkg.com/xterm/-/xterm-4.1.0-beta8.tgz#c1ef323ba336d92f5b52302b66f672dfff75b3ef"
integrity sha512-6lf+XVv0qT285w49P92tSYoUB406jdbgdhnPKNzxCIGtGX8kcwK+pHZ8HncDwcEhmTmI4LZ/WXPGtOQJg+onwg==
xterm@^4.2.0-beta20:
version "4.2.0-beta20"
resolved "https://registry.yarnpkg.com/xterm/-/xterm-4.2.0-beta20.tgz#74a759414511b4577159293397914ac33a2375d8"
integrity sha512-lH52ksaNQqWmLVV4OdLKWvhGkSRUXgJNvb2YYmVkBAm1PdVVS36ir8Qr4zYygnc2tBw689Wj65t4cNckmfpU1Q==

View File

@@ -2,69 +2,6 @@
# yarn lockfile v1
"@microsoft/applicationinsights-analytics-js@2.1.1":
version "2.1.1"
resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-analytics-js/-/applicationinsights-analytics-js-2.1.1.tgz#6d09c1915f808026e2d45165d04802f09affed59"
integrity sha512-VKIutoFKY99CyKwxLUuj6Vnq14/QwXo9/QSQDpYnHEjo+uKn7QmLsHqWw0K9uYNfNAXt4BZimX/zDg6jZtzeXg==
dependencies:
"@microsoft/applicationinsights-common" "2.1.1"
"@microsoft/applicationinsights-core-js" "2.1.1"
tslib "^1.9.3"
"@microsoft/applicationinsights-channel-js@2.1.1":
version "2.1.1"
resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-channel-js/-/applicationinsights-channel-js-2.1.1.tgz#e205eddd93e49d17d9e0711a612b4bfc9810888f"
integrity sha512-fYr9IAqtaEr9AmaPaL3SLQVT3t3GQzl+n74gpNKyAVakDIm0nYQ/bimjdcAhJMDf1VGNSPg/xICneyuZg7Wxlg==
dependencies:
"@microsoft/applicationinsights-common" "2.1.1"
"@microsoft/applicationinsights-core-js" "2.1.1"
tslib "^1.9.3"
"@microsoft/applicationinsights-common@2.1.1":
version "2.1.1"
resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-common/-/applicationinsights-common-2.1.1.tgz#27e6074584a7a3a8ca3f11f7ff2b7ff0f395bf2d"
integrity sha512-2hkS1Ia1FmAjCuYZ5JlG20/WgObqdsKtmK5YALAFGHIB4KSQ/Za1qazS+7GsG+E0F9UJivNWL1geUIcNqg5Qjg==
dependencies:
"@microsoft/applicationinsights-core-js" "2.1.1"
tslib "^1.9.3"
"@microsoft/applicationinsights-core-js@2.1.1":
version "2.1.1"
resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-2.1.1.tgz#30fb6a519cc1c6119c419c4811ce72c260217d9e"
integrity sha512-4t4wf6SKqIcWEQDPg/uOhm+BxtHhu/AFreyEoYZmMfcxzAu33h1FtTQRtxBNbYH1+thiNZCh80yUpnT7d9Hrlw==
dependencies:
tslib "^1.9.3"
"@microsoft/applicationinsights-dependencies-js@2.1.1":
version "2.1.1"
resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-dependencies-js/-/applicationinsights-dependencies-js-2.1.1.tgz#8154c3efcb24617d015d0bce7c2cc47797a8d3c4"
integrity sha512-yhb4EToBp+aI+qLo0h5NDNtoo3sDFV60uyIOK843YjzXqVotcXX/lRShlghTkJtYH09QhrdzDjViUHnD4sMFSQ==
dependencies:
"@microsoft/applicationinsights-common" "2.1.1"
"@microsoft/applicationinsights-core-js" "2.1.1"
tslib "^1.9.3"
"@microsoft/applicationinsights-properties-js@2.1.1":
version "2.1.1"
resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-properties-js/-/applicationinsights-properties-js-2.1.1.tgz#ca34232766eb16167b5d87693e2ae5d94f2a1559"
integrity sha512-8l+/ppw6xKTam2RL4EHZ52Lcf217olw81j6kyBNKtIcGwSnLNHrFwEeF3vBWIteG2JKzlg1GhGjrkB3oxXsV2g==
dependencies:
"@microsoft/applicationinsights-common" "2.1.1"
"@microsoft/applicationinsights-core-js" "2.1.1"
tslib "^1.9.3"
"@microsoft/applicationinsights-web@^2.1.1":
version "2.1.1"
resolved "https://registry.yarnpkg.com/@microsoft/applicationinsights-web/-/applicationinsights-web-2.1.1.tgz#1a44eddda7c244b88d9eb052dab6c855682e4f05"
integrity sha512-crvhCkNsNxkFuPWmttyWNSAA96D5FxBtKS6UA9MV9f9XHevTfchf/E3AuU9JZcsXufWMQLwLrUQ9ZiA1QJ0EWA==
dependencies:
"@microsoft/applicationinsights-analytics-js" "2.1.1"
"@microsoft/applicationinsights-channel-js" "2.1.1"
"@microsoft/applicationinsights-common" "2.1.1"
"@microsoft/applicationinsights-core-js" "2.1.1"
"@microsoft/applicationinsights-dependencies-js" "2.1.1"
"@microsoft/applicationinsights-properties-js" "2.1.1"
agent-base@4, agent-base@^4.1.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.0.tgz#9838b5c3392b962bad031e6a4c5e1024abec45ce"
@@ -79,10 +16,10 @@ agent-base@~4.2.0:
dependencies:
es6-promisify "^5.0.0"
anymatch@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.0.tgz#e609350e50a9313b472789b2f14ef35808ee14d6"
integrity sha512-Ozz7l4ixzI7Oxj2+cw+p0tVUt27BpaJ+1+q1TCeANWxHpvyn2+Un+YamBdfKu0uh8xLodGhoa1v7595NhKDAuA==
anymatch@~3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.1.tgz#c55ecf02185e2469259399310c173ce31233b142"
integrity sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==
dependencies:
normalize-path "^3.0.0"
picomatch "^2.0.4"
@@ -108,7 +45,7 @@ bindings@^1.5.0:
dependencies:
file-uri-to-path "1.0.0"
braces@^3.0.2:
braces@~3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"
integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==
@@ -120,20 +57,20 @@ buffer-crc32@~0.2.3:
resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242"
integrity sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=
chokidar@3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.1.0.tgz#ff23d077682a90eadd209bfa76eb10ed6d359668"
integrity sha512-6vZfo+7W0EOlbSo0nhVKMz4yyssrwiPbBZ8wj1lq8/+l4ZhGZ2U4Md7PspvmijXp1a26D3B7AHEBmIB7aVtaOQ==
chokidar@3.2.2:
version "3.2.2"
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.2.2.tgz#a433973350021e09f2b853a2287781022c0dc935"
integrity sha512-bw3pm7kZ2Wa6+jQWYP/c7bAZy3i4GwiIiMO2EeRjrE48l8vBqC/WvFhSF0xyM8fQiPEGvwMY/5bqDG7sSEOuhg==
dependencies:
anymatch "^3.1.0"
braces "^3.0.2"
glob-parent "^5.0.0"
is-binary-path "^2.1.0"
is-glob "^4.0.1"
normalize-path "^3.0.0"
readdirp "^3.1.1"
anymatch "~3.1.1"
braces "~3.0.2"
glob-parent "~5.1.0"
is-binary-path "~2.1.0"
is-glob "~4.0.1"
normalize-path "~3.0.0"
readdirp "~3.2.0"
optionalDependencies:
fsevents "^2.0.6"
fsevents "~2.1.1"
cookie@^0.4.0:
version "0.4.0"
@@ -199,15 +136,15 @@ fs-extra@^7.0.0:
jsonfile "^4.0.0"
universalify "^0.1.0"
fsevents@^2.0.6:
version "2.0.7"
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.0.7.tgz#382c9b443c6cbac4c57187cdda23aa3bf1ccfc2a"
integrity sha512-a7YT0SV3RB+DjYcppwVDLtn13UQnmg0SWZS7ezZD0UjnLwXmy8Zm21GMVGLaFGimIqcvyMQaOJBrop8MyOp1kQ==
fsevents@~2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.1.tgz#74c64e21df71721845d0c44fe54b7f56b82995a9"
integrity sha512-4FRPXWETxtigtJW/gxzEDsX1LVbPAM93VleB83kZB+ellqbHMkyt2aJfuzNLRvFPnGi6bcE5SvfxgbXPeKteJw==
glob-parent@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.0.0.tgz#1dc99f0f39b006d3e92c2c284068382f0c20e954"
integrity sha512-Z2RwiujPRGluePM6j699ktJYxmPpJKCfpGA13jz2hmFZC7gKetzrWvg5KN3+OsIFmydGyZ1AVwERCq1w/ZZwRg==
glob-parent@~5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.0.tgz#5f4c1d1e748d30cd73ad2944b3577a81b081e8c2"
integrity sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==
dependencies:
is-glob "^4.0.1"
@@ -249,7 +186,7 @@ ip@^1.1.5:
resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.5.tgz#bdded70114290828c0a039e72ef25f5aaec4354a"
integrity sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=
is-binary-path@^2.1.0:
is-binary-path@~2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09"
integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==
@@ -261,7 +198,7 @@ is-extglob@^2.1.1:
resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=
is-glob@^4.0.1:
is-glob@^4.0.1, is-glob@~4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc"
integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==
@@ -334,7 +271,7 @@ node-pty@0.9.0-beta19:
dependencies:
nan "^2.13.2"
normalize-path@^3.0.0:
normalize-path@^3.0.0, normalize-path@~3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65"
integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==
@@ -371,10 +308,10 @@ picomatch@^2.0.4:
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.0.7.tgz#514169d8c7cd0bdbeecc8a2609e34a7163de69f6"
integrity sha512-oLHIdio3tZ0qH76NybpeneBhYVj0QFTfXEFTc/B3zKQspYfYYkWYgFsmzo+4kvId/bQRcNkVeguI3y+CD22BtA==
readdirp@^3.1.1:
version "3.1.2"
resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.1.2.tgz#fa85d2d14d4289920e4671dead96431add2ee78a"
integrity sha512-8rhl0xs2cxfVsqzreYCvs8EwBfn/DhVdqtoLmw19uI3SC5avYX9teCurlErfpPXGmYtMHReGaP2RsLnFvz/lnw==
readdirp@~3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.2.0.tgz#c30c33352b12c96dfb4b895421a49fd5a9593839"
integrity sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ==
dependencies:
picomatch "^2.0.4"
@@ -430,11 +367,6 @@ to-regex-range@^5.0.1:
dependencies:
is-number "^7.0.0"
tslib@^1.9.3:
version "1.10.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a"
integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==
universalify@^0.1.0:
version "0.1.2"
resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66"
@@ -479,20 +411,20 @@ vscode-windows-registry@1.0.2:
resolved "https://registry.yarnpkg.com/vscode-windows-registry/-/vscode-windows-registry-1.0.2.tgz#b863e704a6a69c50b3098a55fbddbe595b0c124a"
integrity sha512-/CLLvuOSM2Vme2z6aNyB+4Omd7hDxpf4Thrt8ImxnXeQtxzel2bClJpFQvQqK/s4oaXlkBKS7LqVLeZM+uSVIA==
xterm-addon-search@0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/xterm-addon-search/-/xterm-addon-search-0.2.0.tgz#46659c7c33f9fc268ad3e7e6c5824bb2fdb65852"
integrity sha512-C/v2VvFn3hb1qUgjJPo7LxzxNCLBgNJv8n6v/bH2NqPz32/PNUF+IHu0SFf1TaIH+pydUpKXCtob5a/UyZg/+Q==
xterm-addon-search@0.3.0-beta5:
version "0.3.0-beta5"
resolved "https://registry.yarnpkg.com/xterm-addon-search/-/xterm-addon-search-0.3.0-beta5.tgz#fd53d33a77a0235018479c712be8c12f7c0d083a"
integrity sha512-3GkGc4hST35/4hzgnQPLLvQ29WH7MkZ0mUrBE/Vm1IQum7TnMvWPTkGemwM+wAl4tdBmynNccHJlFeQzaQtVUg==
xterm-addon-web-links@0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/xterm-addon-web-links/-/xterm-addon-web-links-0.2.0.tgz#b408a0be46211d8d4a0bb5e701d8f3c2bd07d473"
integrity sha512-dq81c4Pzli2PgKVBgY2REte9sCVibR3df8AP3SEvCTM9uYFnUFxtxzMTplPnc7+rXabVhFdbU6x+rstIk8HNQg==
xterm-addon-web-links@0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/xterm-addon-web-links/-/xterm-addon-web-links-0.2.1.tgz#6d1f2ce613e09870badf17615e7a1170a31542b2"
integrity sha512-2KnHtiq0IG7hfwv3jw2/jQeH1RBk2d5CH4zvgwQe00rLofSJqSfgnJ7gwowxxpGHrpbPr6Lv4AmH/joaNw2+HQ==
xterm@4.1.0-beta8:
version "4.1.0-beta8"
resolved "https://registry.yarnpkg.com/xterm/-/xterm-4.1.0-beta8.tgz#c1ef323ba336d92f5b52302b66f672dfff75b3ef"
integrity sha512-6lf+XVv0qT285w49P92tSYoUB406jdbgdhnPKNzxCIGtGX8kcwK+pHZ8HncDwcEhmTmI4LZ/WXPGtOQJg+onwg==
xterm@^4.2.0-beta20:
version "4.2.0-beta20"
resolved "https://registry.yarnpkg.com/xterm/-/xterm-4.2.0-beta20.tgz#74a759414511b4577159293397914ac33a2375d8"
integrity sha512-lH52ksaNQqWmLVV4OdLKWvhGkSRUXgJNvb2YYmVkBAm1PdVVS36ir8Qr4zYygnc2tBw689Wj65t4cNckmfpU1Q==
yauzl@^2.9.2:
version "2.10.0"

View File

@@ -30,7 +30,7 @@ if [ ! -L $0 ]; then
# if path is not a symlink, find relatively
VSCODE_PATH="$(dirname $0)/.."
else
if which readlink >/dev/null; then
if command -v readlink >/dev/null; then
# if readlink exists, follow the symlink and find relatively
VSCODE_PATH="$(dirname $(readlink -f $0))/.."
else

View File

@@ -2,7 +2,7 @@
Name=@@NAME_LONG@@ - URL Handler
Comment=Azure Data Studio
GenericName=Text Editor
Exec=@@EXEC@@ --open-url %U
Exec=@@EXEC@@ --no-sandbox --open-url %U
Icon=@@ICON@@
Type=Application
NoDisplay=true

View File

@@ -2,7 +2,7 @@
Name=@@NAME_LONG@@
Comment=Data Management Tool that enables you to work with SQL Server, Azure SQL DB and SQL DW from Windows, macOS and Linux.
GenericName=Text Editor
Exec=@@EXEC@@ --unity-launch %F
Exec=@@EXEC@@ --no-sandbox --unity-launch %F
Icon=@@ICON@@
Type=Application
StartupNotify=false
@@ -14,5 +14,5 @@ Keywords=azuredatastudio;
[Desktop Action new-empty-window]
Name=New Empty Window
Exec=@@EXEC@@ --new-window %F
Exec=@@EXEC@@ --no-sandbox --new-window %F
Icon=@@ICON@@

0
resources/win32/inno-big-125.bmp Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 201 KiB

After

Width:  |  Height:  |  Size: 201 KiB

0
resources/win32/inno-big-150.bmp Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 332 KiB

After

Width:  |  Height:  |  Size: 332 KiB

0
resources/win32/inno-big-175.bmp Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 445 KiB

After

Width:  |  Height:  |  Size: 445 KiB

0
resources/win32/inno-big-200.bmp Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 580 KiB

After

Width:  |  Height:  |  Size: 580 KiB

0
resources/win32/inno-big-225.bmp Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 730 KiB

After

Width:  |  Height:  |  Size: 730 KiB

0
resources/win32/inno-small-100.bmp Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

0
resources/win32/inno-small-125.bmp Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

0
resources/win32/inno-small-150.bmp Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

0
resources/win32/inno-small-175.bmp Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

0
resources/win32/inno-small-200.bmp Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

0
resources/win32/inno-small-225.bmp Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 43 KiB

0
resources/win32/inno-small-250.bmp Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 57 KiB

View File

@@ -24,7 +24,7 @@ if "%1"=="--builtin" goto builtin
node build\lib\builtInExtensions.js
:: Build
if not exist out node .\node_modules\gulp\bin\gulp.js compile
if not exist out yarn compile
:: Configuration
set ELECTRON_RUN_AS_NODE=1

View File

@@ -22,8 +22,7 @@ function code() {
test -d node_modules || yarn
# Get electron
node build/lib/electron.js || ./node_modules/.bin/gulp electron
yarn electron
# Manage built-in extensions
if [[ "$1" == "--builtin" ]]; then
@@ -35,7 +34,7 @@ function code() {
node build/lib/builtInExtensions.js
# Build
test -d out || ./node_modules/.bin/gulp compile
test -d out || yarn compile
ELECTRON_RUN_AS_NODE=1 \
NODE_ENV=development \

225
scripts/code-web.js Executable file
View File

@@ -0,0 +1,225 @@
#!/usr/bin/env node
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// @ts-check
const http = require('http');
const url = require('url');
const fs = require('fs');
const path = require('path');
const util = require('util');
const opn = require('opn');
const minimist = require('vscode-minimist');
const APP_ROOT = path.dirname(__dirname);
const WEB_MAIN = path.join(APP_ROOT, 'src', 'vs', 'code', 'browser', 'workbench', 'workbench-dev.html');
const PORT = 8080;
const args = minimist(process.argv, {
string: [
'no-launch'
]
});
const server = http.createServer((req, res) => {
const parsedUrl = url.parse(req.url, true);
const pathname = parsedUrl.pathname;
try {
if (pathname === '/favicon.ico') {
// favicon
return serveFile(req, res, path.join(APP_ROOT, 'resources', 'win32', 'code.ico'));
}
if (/^\/static\//.test(pathname)) {
// static requests
return handleStatic(req, res, parsedUrl);
}
if (/^\/static-extension\//.test(pathname)) {
// static extension requests
return handleStaticExtension(req, res, parsedUrl);
}
if (pathname === '/') {
// main web
return handleRoot(req, res);
}
return serveError(req, res, 404, 'Not found.');
} catch (error) {
console.error(error.toString());
return serveError(req, res, 500, 'Internal Server Error.');
}
});
server.listen(PORT, () => {
console.log(`Web UI available at http://localhost:${PORT}`);
});
server.on('error', err => {
console.error(`Error occurred in server:`);
console.error(err);
});
/**
* @param {import('http').IncomingMessage} req
* @param {import('http').ServerResponse} res
* @param {import('url').UrlWithParsedQuery} parsedUrl
*/
function handleStatic(req, res, parsedUrl) {
// Strip `/static/` from the path
const relativeFilePath = path.normalize(decodeURIComponent(parsedUrl.pathname.substr('/static/'.length)));
return serveFile(req, res, path.join(APP_ROOT, relativeFilePath));
}
/**
* @param {import('http').IncomingMessage} req
* @param {import('http').ServerResponse} res
* @param {import('url').UrlWithParsedQuery} parsedUrl
*/
function handleStaticExtension(req, res, parsedUrl) {
// Strip `/static-extension/` from the path
const relativeFilePath = path.normalize(decodeURIComponent(parsedUrl.pathname.substr('/static-extension/'.length)));
const filePath = path.join(APP_ROOT, 'extensions', relativeFilePath);
return serveFile(req, res, filePath);
}
/**
* @param {import('http').IncomingMessage} req
* @param {import('http').ServerResponse} res
*/
async function handleRoot(req, res) {
const extensionFolders = await util.promisify(fs.readdir)(path.join(APP_ROOT, 'extensions'));
const mapExtensionFolderToExtensionPackageJSON = new Map();
await Promise.all(extensionFolders.map(async extensionFolder => {
try {
const packageJSON = JSON.parse((await util.promisify(fs.readFile)(path.join(APP_ROOT, 'extensions', extensionFolder, 'package.json'))).toString());
if (packageJSON.main && packageJSON.name !== 'vscode-api-tests') {
return; // unsupported
}
if (packageJSON.name === 'scss') {
return; // seems to fail to JSON.parse()?!
}
packageJSON.extensionKind = 'web'; // enable for Web
mapExtensionFolderToExtensionPackageJSON.set(extensionFolder, packageJSON);
} catch (error) {
return null;
}
}));
const staticExtensions = [];
// Built in extensions
mapExtensionFolderToExtensionPackageJSON.forEach((packageJSON, extensionFolder) => {
staticExtensions.push({
packageJSON,
extensionLocation: { scheme: 'http', authority: `localhost:${PORT}`, path: `/static-extension/${extensionFolder}` }
});
});
const data = (await util.promisify(fs.readFile)(WEB_MAIN)).toString()
.replace('{{WORKBENCH_WEB_CONFIGURATION}}', escapeAttribute(JSON.stringify({
staticExtensions,
folderUri: { scheme: 'memfs', path: `/` }
})))
.replace('{{WEBVIEW_ENDPOINT}}', '')
.replace('{{REMOTE_USER_DATA_URI}}', '');
res.writeHead(200, { 'Content-Type': 'text/html' });
return res.end(data);
}
/**
* @param {string} value
*/
function escapeAttribute(value) {
return value.replace(/"/g, '&quot;');
}
/**
* @param {import('http').IncomingMessage} req
* @param {import('http').ServerResponse} res
* @param {string} errorMessage
*/
function serveError(req, res, errorCode, errorMessage) {
res.writeHead(errorCode, { 'Content-Type': 'text/plain' });
res.end(errorMessage);
}
const textMimeType = {
'.html': 'text/html',
'.js': 'text/javascript',
'.json': 'application/json',
'.css': 'text/css',
'.svg': 'image/svg+xml',
};
const mapExtToMediaMimes = {
'.bmp': 'image/bmp',
'.gif': 'image/gif',
'.ico': 'image/x-icon',
'.jpe': 'image/jpg',
'.jpeg': 'image/jpg',
'.jpg': 'image/jpg',
'.png': 'image/png',
'.tga': 'image/x-tga',
'.tif': 'image/tiff',
'.tiff': 'image/tiff',
'.woff': 'application/font-woff'
};
/**
* @param {string} forPath
*/
function getMediaMime(forPath) {
const ext = path.extname(forPath);
return mapExtToMediaMimes[ext.toLowerCase()];
}
/**
* @param {import('http').IncomingMessage} req
* @param {import('http').ServerResponse} res
* @param {string} filePath
*/
async function serveFile(req, res, filePath, responseHeaders = Object.create(null)) {
try {
const stat = await util.promisify(fs.stat)(filePath);
// Check if file modified since
const etag = `W/"${[stat.ino, stat.size, stat.mtime.getTime()].join('-')}"`; // weak validator (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag)
if (req.headers['if-none-match'] === etag) {
res.writeHead(304);
return res.end();
}
// Headers
responseHeaders['Content-Type'] = textMimeType[path.extname(filePath)] || getMediaMime(filePath) || 'text/plain';
responseHeaders['Etag'] = etag;
res.writeHead(200, responseHeaders);
// Data
fs.createReadStream(filePath).pipe(res);
} catch (error) {
console.error(error.toString());
res.writeHead(404, { 'Content-Type': 'text/plain' });
return res.end('Not found');
}
}
if (args.launch !== false) {
opn(`http://localhost:${PORT}`);
}

View File

@@ -24,7 +24,7 @@ if "%1"=="--builtin" goto builtin
node build\lib\builtInExtensions.js
:: Build
if not exist out node .\node_modules\gulp\bin\gulp.js compile
if not exist out yarn compile
:: Configuration
set NODE_ENV=development

View File

@@ -27,7 +27,7 @@ function code() {
test -d node_modules || yarn
# Get electron
node build/lib/electron.js || ./node_modules/.bin/gulp electron
yarn electron
# Manage built-in extensions
if [[ "$1" == "--builtin" ]]; then
@@ -39,7 +39,7 @@ function code() {
node build/lib/builtInExtensions.js
# Build
test -d out || ./node_modules/.bin/gulp compile
test -d out || yarn compile
# Configuration
export NODE_ENV=development

View File

@@ -18,7 +18,7 @@ else
fi
# Get electron
node build/lib/electron.js || ./node_modules/.bin/gulp electron
yarn electron
popd

View File

@@ -30,22 +30,22 @@ if "%INTEGRATION_TEST_ELECTRON_PATH%"=="" (
:: if %errorlevel% neq 0 exit /b %errorlevel%
:: Tests in the extension host
call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\vscode-api-tests\testWorkspace --extensionDevelopmentPath=%~dp0\..\extensions\vscode-api-tests --extensionTestsPath=%~dp0\..\extensions\vscode-api-tests\out\singlefolder-tests --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --disable-inspect --user-data-dir=%VSCODEUSERDATADIR%
call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\vscode-api-tests\testWorkspace --enable-proposed-api=vscode.vscode-api-tests --extensionDevelopmentPath=%~dp0\..\extensions\vscode-api-tests --extensionTestsPath=%~dp0\..\extensions\vscode-api-tests\out\singlefolder-tests --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --user-data-dir=%VSCODEUSERDATADIR%
if %errorlevel% neq 0 exit /b %errorlevel%
call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\vscode-api-tests\testworkspace.code-workspace --extensionDevelopmentPath=%~dp0\..\extensions\vscode-api-tests --extensionTestsPath=%~dp0\..\extensions\vscode-api-tests\out\workspace-tests --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --disable-inspect --user-data-dir=%VSCODEUSERDATADIR%
call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\vscode-api-tests\testworkspace.code-workspace --enable-proposed-api=vscode.vscode-api-tests --extensionDevelopmentPath=%~dp0\..\extensions\vscode-api-tests --extensionTestsPath=%~dp0\..\extensions\vscode-api-tests\out\workspace-tests --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --user-data-dir=%VSCODEUSERDATADIR%
if %errorlevel% neq 0 exit /b %errorlevel%
call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\vscode-colorize-tests\test --extensionDevelopmentPath=%~dp0\..\extensions\vscode-colorize-tests --extensionTestsPath=%~dp0\..\extensions\vscode-colorize-tests\out --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --disable-inspect --user-data-dir=%VSCODEUSERDATADIR%
call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\markdown-language-features\test-fixtures --extensionDevelopmentPath=%~dp0\..\extensions\markdown-language-features --extensionTestsPath=%~dp0\..\extensions\markdown-language-features\out\test --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --disable-inspect --user-data-dir=%VSCODEUSERDATADIR%
call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\azurecore\test-fixtures --extensionDevelopmentPath=%~dp0\..\extensions\azurecore --extensionTestsPath=%~dp0\..\extensions\azurecore\out\test --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --disable-inspect --user-data-dir=%VSCODEUSERDATADIR%
call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\vscode-colorize-tests\test --extensionDevelopmentPath=%~dp0\..\extensions\vscode-colorize-tests --extensionTestsPath=%~dp0\..\extensions\vscode-colorize-tests\out --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --user-data-dir=%VSCODEUSERDATADIR%
if %errorlevel% neq 0 exit /b %errorlevel%
:: call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\vscode-colorize-tests\test --extensionDevelopmentPath=%~dp0\..\extensions\vscode-colorize-tests --extensionTestsPath=%~dp0\..\extensions\vscode-colorize-tests\out --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --disable-inspect --user-data-dir=%VSCODEUSERDATADIR%
:: call "%INTEGRATION_TEST_ELECTRON_PATH%" $%~dp0\..\extensions\emmet\test-fixtures --extensionDevelopmentPath=%~dp0\..\extensions\emmet --extensionTestsPath=%~dp0\..\extensions\emmet\out\test --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --user-data-dir=%VSCODEUSERDATADIR% .
:: if %errorlevel% neq 0 exit /b %errorlevel%
:: call "%INTEGRATION_TEST_ELECTRON_PATH%" $%~dp0\..\extensions\emmet\test-fixtures --extensionDevelopmentPath=%~dp0\..\extensions\emmet --extensionTestsPath=%~dp0\..\extensions\emmet\out\test --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --disable-inspect --user-data-dir=%VSCODEUSERDATADIR% .
:: if %errorlevel% neq 0 exit /b %errorlevel%
call "%INTEGRATION_TEST_ELECTRON_PATH%" %~dp0\..\extensions\azurecore\test-fixtures --extensionDevelopmentPath=%~dp0\..\extensions\azurecore --extensionTestsPath=%~dp0\..\extensions\azurecore\out\test --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --user-data-dir=%VSCODEUSERDATADIR%
if %errorlevel% neq 0 exit /b %errorlevel%
:: Tests in commonJS (HTML, CSS, JSON language server tests...)
call .\scripts\node-electron.bat .\node_modules\mocha\bin\_mocha .\extensions\*\server\out\test\**\*.test.js

View File

@@ -8,7 +8,7 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
else
ROOT=$(dirname $(dirname $(readlink -f $0)))
VSCODEUSERDATADIR=`mktemp -d 2>/dev/null`
LINUX_NO_SANDBOX=""
LINUX_NO_SANDBOX="--no-sandbox" # Electron 6 introduces a chrome-sandbox that requires root to run. This can fail. Disable sandbox via --no-sandbox.
fi
cd $ROOT
@@ -37,14 +37,15 @@ fi
./scripts/test.sh --runGlob **/*.integrationTest.js "$@"
# Tests in the extension host
# "$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_NO_SANDBOX $ROOT/extensions/vscode-api-tests/testWorkspace --extensionDevelopmentPath=$ROOT/extensions/vscode-api-tests --extensionTestsPath=$ROOT/extensions/vscode-api-tests/out/singlefolder-tests --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --skip-getting-started --disable-inspect --user-data-dir=$VSCODEUSERDATADIR
# "$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_NO_SANDBOX $ROOT/extensions/vscode-api-tests/testworkspace.code-workspace --extensionDevelopmentPath=$ROOT/extensions/vscode-api-tests --extensionTestsPath=$ROOT/extensions/vscode-api-tests/out/workspace-tests --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --skip-getting-started --disable-inspect --user-data-dir=$VSCODEUSERDATADIR
"$INTEGRATION_TEST_ELECTRON_PATH" $ROOT/extensions/vscode-colorize-tests/test --extensionDevelopmentPath=$ROOT/extensions/vscode-colorize-tests --extensionTestsPath=$ROOT/extensions/vscode-colorize-tests/out --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --skip-getting-started --disable-inspect --user-data-dir=$VSCODEUSERDATADIR
"$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_NO_SANDBOX $ROOT/extensions/markdown-language-features/test-fixtures --extensionDevelopmentPath=$ROOT/extensions/markdown-language-features --extensionTestsPath=$ROOT/extensions/markdown-language-features/out/test --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --skip-getting-started --disable-inspect --user-data-dir=$VSCODEUSERDATADIR
"$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_NO_SANDBOX $ROOT/extensions/azurecore/test-fixtures --extensionDevelopmentPath=$ROOT/extensions/azurecore --extensionTestsPath=$ROOT/extensions/azurecore/out/test --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --skip-getting-started --disable-inspect --user-data-dir=$VSCODEUSERDATADIR
# "$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_NO_SANDBOX $ROOT/extensions/vscode-api-tests/testWorkspace --enable-proposed-api=vscode.vscode-api-tests --extensionDevelopmentPath=$ROOT/extensions/vscode-api-tests --extensionTestsPath=$ROOT/extensions/vscode-api-tests/out/singlefolder-tests --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --skip-getting-started --user-data-dir=$VSCODEUSERDATADIR
# "$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_NO_SANDBOX $ROOT/extensions/vscode-api-tests/testworkspace.code-workspace --enable-proposed-api=vscode.vscode-api-tests --extensionDevelopmentPath=$ROOT/extensions/vscode-api-tests --extensionTestsPath=$ROOT/extensions/vscode-api-tests/out/workspace-tests --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --skip-getting-started --user-data-dir=$VSCODEUSERDATADIR
"$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_NO_SANDBOX $ROOT/extensions/vscode-colorize-tests/test --extensionDevelopmentPath=$ROOT/extensions/vscode-colorize-tests --extensionTestsPath=$ROOT/extensions/vscode-colorize-tests/out --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --skip-getting-started --user-data-dir=$VSCODEUSERDATADIR
"$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_NO_SANDBOX $ROOT/extensions/markdown-language-features/test-fixtures --extensionDevelopmentPath=$ROOT/extensions/markdown-language-features --extensionTestsPath=$ROOT/extensions/markdown-language-features/out/test --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --skip-getting-started --user-data-dir=$VSCODEUSERDATADIR
"$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_NO_SANDBOX $ROOT/extensions/azurecore/test-fixtures --extensionDevelopmentPath=$ROOT/extensions/azurecore --extensionTestsPath=$ROOT/extensions/azurecore/out/test --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --skip-getting-started --user-data-dir=$VSCODEUSERDATADIR
mkdir -p $ROOT/extensions/emmet/test-fixtures
"$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_NO_SANDBOX $ROOT/extensions/emmet/test-fixtures --extensionDevelopmentPath=$ROOT/extensions/emmet --extensionTestsPath=$ROOT/extensions/emmet/out/test --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --skip-getting-started --disable-inspect --user-data-dir=$VSCODEUSERDATADIR
"$INTEGRATION_TEST_ELECTRON_PATH" $LINUX_NO_SANDBOX $ROOT/extensions/emmet/test-fixtures --extensionDevelopmentPath=$ROOT/extensions/emmet --extensionTestsPath=$ROOT/extensions/emmet/out/test --disable-telemetry --disable-crash-reporter --disable-updates --disable-extensions --skip-getting-started --user-data-dir=$VSCODEUSERDATADIR
rm -rf $ROOT/extensions/emmet/test-fixtures
# Remote Integration Tests

View File

@@ -35,7 +35,7 @@ fi
test -d node_modules || yarn
# Get electron
node build/lib/electron.js || ./node_modules/.bin/gulp electron
yarn electron
# Unit Tests
if [[ "$OSTYPE" == "darwin"* ]] || [[ "$AGENT_OS" == "Darwin"* ]]; then
@@ -47,5 +47,5 @@ else
cd $ROOT ; \
ELECTRON_ENABLE_LOGGING=1 \
"$CODE" \
test/electron/index.js $CODE_ARGS "$@"
test/electron/index.js --no-sandbox "$@" # Electron 6 introduces a chrome-sandbox that requires root to run. This can fail. Disable sandbox via --no-sandbox.
fi

View File

@@ -21,7 +21,7 @@ exports.assign = function assign(destination, source) {
*
* @param {string[]} modulePaths
* @param {(result, configuration: object) => any} resultCallback
* @param {{ forceEnableDeveloperKeybindings?: boolean, removeDeveloperKeybindingsAfterLoad?: boolean, canModifyDOM?: (config: object) => void, beforeLoaderConfig?: (config: object, loaderConfig: object) => void, beforeRequire?: () => void }=} options
* @param {{ forceEnableDeveloperKeybindings?: boolean, disallowReloadKeybinding?: boolean, removeDeveloperKeybindingsAfterLoad?: boolean, canModifyDOM?: (config: object) => void, beforeLoaderConfig?: (config: object, loaderConfig: object) => void, beforeRequire?: () => void }=} options
*/
exports.load = function (modulePaths, resultCallback, options) {
@@ -58,7 +58,7 @@ exports.load = function (modulePaths, resultCallback, options) {
const enableDeveloperTools = (process.env['VSCODE_DEV'] || !!configuration.extensionDevelopmentPath) && !configuration.extensionTestsPath;
let developerToolsUnbind;
if (enableDeveloperTools || (options && options.forceEnableDeveloperKeybindings)) {
developerToolsUnbind = registerDeveloperKeybindings();
developerToolsUnbind = registerDeveloperKeybindings(options && options.disallowReloadKeybinding);
}
// Correctly inherit the parent's environment
@@ -178,9 +178,10 @@ function parseURLQueryArgs() {
}
/**
* @param {boolean} disallowReloadKeybinding
* @returns {() => void}
*/
function registerDeveloperKeybindings() {
function registerDeveloperKeybindings(disallowReloadKeybinding) {
// @ts-ignore
const ipc = require('electron').ipcRenderer;
@@ -204,7 +205,7 @@ function registerDeveloperKeybindings() {
const key = extractKey(e);
if (key === TOGGLE_DEV_TOOLS_KB || key === TOGGLE_DEV_TOOLS_KB_ALT) {
ipc.send('vscode:toggleDevTools');
} else if (key === RELOAD_KB) {
} else if (key === RELOAD_KB && !disallowReloadKeybinding) {
ipc.send('vscode:reloadWindow');
}
};

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