Merge VS Code 1.21 source code (#1067)

* Initial VS Code 1.21 file copy with patches

* A few more merges

* Post npm install

* Fix batch of build breaks

* Fix more build breaks

* Fix more build errors

* Fix more build breaks

* Runtime fixes 1

* Get connection dialog working with some todos

* Fix a few packaging issues

* Copy several node_modules to package build to fix loader issues

* Fix breaks from master

* A few more fixes

* Make tests pass

* First pass of license header updates

* Second pass of license header updates

* Fix restore dialog issues

* Remove add additional themes menu items

* fix select box issues where the list doesn't show up

* formatting

* Fix editor dispose issue

* Copy over node modules to correct location on all platforms
This commit is contained in:
Karl Burtram
2018-04-04 15:27:51 -07:00
committed by GitHub
parent 5fba3e31b4
commit dafb780987
9412 changed files with 141255 additions and 98813 deletions

View File

@@ -12,8 +12,8 @@ cache:
notifications: notifications:
email: false email: false
webhooks: webhooks:
- http://vscode-probot.westus.cloudapp.azure.com:3450/travis/notifications - https://vscode-probot.westus.cloudapp.azure.com:7890/travis/notifications
- http://vscode-test-probot.westus.cloudapp.azure.com:3450/travis/notifications - https://vscode-test-probot.westus.cloudapp.azure.com:7890/travis/notifications
addons: addons:
apt: apt:
@@ -31,6 +31,7 @@ addons:
- libsecret-1-dev - libsecret-1-dev
before_install: before_install:
- export GITHUB_TOKEN=$PUBLIC_GITHUB_TOKEN
- git submodule update --init --recursive - git submodule update --init --recursive
- git clone --depth 1 https://github.com/creationix/nvm.git ./.nvm - git clone --depth 1 https://github.com/creationix/nvm.git ./.nvm
- source ./.nvm/nvm.sh - source ./.nvm/nvm.sh
@@ -52,9 +53,17 @@ install:
script: script:
- node_modules/.bin/gulp electron --silent - node_modules/.bin/gulp electron --silent
- node_modules/.bin/tsc -p ./src/tsconfig.monaco.json --noEmit
- node_modules/.bin/gulp compile --silent --max_old_space_size=4096 - node_modules/.bin/gulp compile --silent --max_old_space_size=4096
- node_modules/.bin/gulp optimize-vscode --silent --max_old_space_size=4096
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./scripts/test.sh --coverage --reporter dot; else ./scripts/test.sh --reporter dot; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./scripts/test.sh --coverage --reporter dot; else ./scripts/test.sh --reporter dot; fi
- ./scripts/test-integration.sh
after_success: after_success:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then node_modules/.bin/coveralls < .build/coverage/lcov.info; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then node_modules/.bin/coveralls < .build/coverage/lcov.info; fi
matrix:
include:
- os: linux
env: label=hygiene
script: node_modules/.bin/gulp hygiene
after_success: skip

6
.vscode/launch.json vendored
View File

@@ -1,7 +1,6 @@
{ {
"version": "0.1.0", "version": "0.1.0",
"configurations": [ "configurations": [
{ {
"type": "node", "type": "node",
"request": "launch", "request": "launch",
@@ -9,7 +8,7 @@
"program": "${workspaceFolder}/node_modules/gulp/bin/gulp.js", "program": "${workspaceFolder}/node_modules/gulp/bin/gulp.js",
"stopOnEntry": true, "stopOnEntry": true,
"args": [ "args": [
"watch-extension:json-client" "hygiene"
], ],
"cwd": "${workspaceFolder}" "cwd": "${workspaceFolder}"
}, },
@@ -87,6 +86,9 @@
"runtimeArgs": [ "runtimeArgs": [
"--inspect=5875" "--inspect=5875"
], ],
"skipFiles": [
"**/winjs*.js"
],
"webRoot": "${workspaceFolder}" "webRoot": "${workspaceFolder}"
}, },
{ {

View File

@@ -10,6 +10,9 @@
"when": "$(basename).ts" "when": "$(basename).ts"
} }
}, },
"files.associations": {
"OSSREADME.json": "jsonc"
},
"search.exclude": { "search.exclude": {
"**/node_modules": true, "**/node_modules": true,
"**/bower_components": true, "**/bower_components": true,
@@ -35,6 +38,5 @@
} }
} }
], ],
"typescript.tsdk": "node_modules/typescript/lib", "typescript.tsdk": "node_modules/typescript/lib"
"git.ignoreLimitWarning": true
} }

View File

@@ -11,6 +11,7 @@ install:
build_script: build_script:
- yarn - yarn
- .\node_modules\.bin\gulp electron - .\node_modules\.bin\gulp electron
- .\node_modules\.bin\tsc -p .\src\tsconfig.monaco.json --noEmit
- npm run compile - npm run compile
test_script: test_script:

View File

@@ -0,0 +1,12 @@
[
{
"name": "ms-vscode.node-debug",
"version": "1.21.8",
"repo": "https://github.com/Microsoft/vscode-node-debug"
},
{
"name": "ms-vscode.node-debug2",
"version": "1.21.2",
"repo": "https://github.com/Microsoft/vscode-node-debug2"
}
]

20
build/builtin/.eslintrc Normal file
View File

@@ -0,0 +1,20 @@
{
"env": {
"node": true,
"es6": true,
"browser": true
},
"rules": {
"no-console": 0,
"no-cond-assign": 0,
"no-unused-vars": 1,
"no-extra-semi": "warn",
"semi": "warn"
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true
}
}
}

View File

@@ -0,0 +1,126 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
const fs = require('fs');
const path = require('path');
const os = require('os');
// @ts-ignore review
const { remote } = require('electron');
const dialog = remote.dialog;
const builtInExtensionsPath = path.join(__dirname, '..', 'builtInExtensions.json');
const controlFilePath = path.join(os.homedir(), '.vscode-oss-dev', 'extensions', 'control.json');
function readJson(filePath) {
return JSON.parse(fs.readFileSync(filePath, { encoding: 'utf8' }));
}
function writeJson(filePath, obj) {
fs.writeFileSync(filePath, JSON.stringify(obj, null, 2));
}
function renderOption(form, id, title, value, checked) {
const input = document.createElement('input');
input.type = 'radio';
input.id = id;
input.name = 'choice';
input.value = value;
input.checked = !!checked;
form.appendChild(input);
const label = document.createElement('label');
label.setAttribute('for', id);
label.textContent = title;
form.appendChild(label);
return input;
}
function render(el, state) {
function setState(state) {
try {
writeJson(controlFilePath, state.control);
} catch (err) {
console.error(err);
}
el.innerHTML = '';
render(el, state);
}
const ul = document.createElement('ul');
const { builtin, control } = state;
for (const ext of builtin) {
const controlState = control[ext.name] || 'marketplace';
const li = document.createElement('li');
ul.appendChild(li);
const name = document.createElement('code');
name.textContent = ext.name;
li.appendChild(name);
const form = document.createElement('form');
li.appendChild(form);
const marketplaceInput = renderOption(form, `marketplace-${ext.name}`, 'Marketplace', 'marketplace', controlState === 'marketplace');
marketplaceInput.onchange = function () {
control[ext.name] = 'marketplace';
setState({ builtin, control });
};
const disabledInput = renderOption(form, `disabled-${ext.name}`, 'Disabled', 'disabled', controlState === 'disabled');
disabledInput.onchange = function () {
control[ext.name] = 'disabled';
setState({ builtin, control });
};
let local = undefined;
if (controlState !== 'marketplace' && controlState !== 'disabled') {
local = controlState;
}
const localInput = renderOption(form, `local-${ext.name}`, 'Local', 'local', !!local);
localInput.onchange = function () {
const result = dialog.showOpenDialog(remote.getCurrentWindow(), {
title: 'Choose Folder',
properties: ['openDirectory']
});
if (result && result.length >= 1) {
control[ext.name] = result[0];
}
setState({ builtin, control });
};
if (local) {
const localSpan = document.createElement('code');
localSpan.className = 'local';
localSpan.textContent = local;
form.appendChild(localSpan);
}
}
el.appendChild(ul);
}
function main() {
const el = document.getElementById('extensions');
const builtin = readJson(builtInExtensionsPath);
let control;
try {
control = readJson(controlFilePath);
} catch (err) {
control = {};
}
render(el, { builtin, control });
}
window.onload = main;

46
build/builtin/index.html Normal file
View File

@@ -0,0 +1,46 @@
<!-- Copyright (C) Microsoft Corporation. All rights reserved. -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Manage Built-in Extensions</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="browser-main.js"></script>
<style>
body {
font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
font-size: 10pt;
}
code {
font-family: 'Menlo', 'Courier New', 'Courier', monospace;
}
ul {
padding-left: 1em;
}
li {
list-style: none;
padding: 0.3em 0;
}
label {
margin-right: 1em;
}
form {
padding: 0.3em 0 0.3em 0.3em;
}
</style>
</head>
<body>
<h1>Built-in Extensions</h1>
<div id="extensions"></div>
</body>
</html>

20
build/builtin/main.js Normal file
View File

@@ -0,0 +1,20 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
const { app, BrowserWindow } = require('electron');
const url = require('url');
const path = require('path');
let window = null;
app.once('ready', () => {
window = new BrowserWindow({ width: 800, height: 600 });
window.setMenuBarVisibility(false);
window.loadURL(url.format({ pathname: path.join(__dirname, 'index.html'), protocol: 'file:', slashes: true }));
// window.webContents.openDevTools();
window.once('closed', () => window = null);
});
app.on('window-all-closed', () => app.quit());

View File

@@ -0,0 +1,5 @@
{
"name": "builtin",
"version": "0.1.0",
"main": "main.js"
}

View File

@@ -12,6 +12,7 @@ var File = require('vinyl');
var root = path.dirname(__dirname); var root = path.dirname(__dirname);
var sha1 = util.getVersion(root); var sha1 = util.getVersion(root);
// @ts-ignore Microsoft/TypeScript#21262 complains about a require of a JSON file
var semver = require('./monaco/package.json').version; var semver = require('./monaco/package.json').version;
var headerVersion = semver + '(' + sha1 + ')'; var headerVersion = semver + '(' + sha1 + ')';
@@ -21,14 +22,14 @@ var editorEntryPoints = [
{ {
name: 'vs/editor/editor.main', name: 'vs/editor/editor.main',
include: [], include: [],
exclude: [ 'vs/css', 'vs/nls' ], exclude: ['vs/css', 'vs/nls'],
prepend: [ 'out-build/vs/css.js', 'out-build/vs/nls.js' ], prepend: ['out-build/vs/css.js', 'out-build/vs/nls.js'],
}, },
{ {
name: 'vs/base/common/worker/simpleWorker', name: 'vs/base/common/worker/simpleWorker',
include: [ 'vs/editor/common/services/editorSimpleWorker' ], include: ['vs/editor/common/services/editorSimpleWorker'],
prepend: [ 'vs/loader.js' ], prepend: ['vs/loader.js'],
append: [ 'vs/base/worker/workerMain' ], append: ['vs/base/worker/workerMain'],
dest: 'vs/base/worker/workerMain.js' dest: 'vs/base/worker/workerMain.js'
} }
]; ];
@@ -79,14 +80,15 @@ gulp.task('optimize-editor', ['clean-optimized-editor', 'compile-client-build'],
bundleLoader: false, bundleLoader: false,
header: BUNDLED_FILE_HEADER, header: BUNDLED_FILE_HEADER,
bundleInfo: true, bundleInfo: true,
out: 'out-editor' out: 'out-editor',
languages: undefined
})); }));
gulp.task('clean-minified-editor', util.rimraf('out-editor-min')); gulp.task('clean-minified-editor', util.rimraf('out-editor-min'));
gulp.task('minify-editor', ['clean-minified-editor', 'optimize-editor'], common.minifyTask('out-editor')); gulp.task('minify-editor', ['clean-minified-editor', 'optimize-editor'], common.minifyTask('out-editor'));
gulp.task('clean-editor-distro', util.rimraf('out-monaco-editor-core')); gulp.task('clean-editor-distro', util.rimraf('out-monaco-editor-core'));
gulp.task('editor-distro', ['clean-editor-distro', 'minify-editor', 'optimize-editor'], function() { gulp.task('editor-distro', ['clean-editor-distro', 'minify-editor', 'optimize-editor'], function () {
return es.merge( return es.merge(
// other assets // other assets
es.merge( es.merge(
@@ -97,17 +99,17 @@ gulp.task('editor-distro', ['clean-editor-distro', 'minify-editor', 'optimize-ed
// package.json // package.json
gulp.src('build/monaco/package.json') gulp.src('build/monaco/package.json')
.pipe(es.through(function(data) { .pipe(es.through(function (data) {
var json = JSON.parse(data.contents.toString()); var json = JSON.parse(data.contents.toString());
json.private = false; json.private = false;
data.contents = new Buffer(JSON.stringify(json, null, ' ')); data.contents = Buffer.from(JSON.stringify(json, null, ' '));
this.emit('data', data); this.emit('data', data);
})) }))
.pipe(gulp.dest('out-monaco-editor-core')), .pipe(gulp.dest('out-monaco-editor-core')),
// README.md // README.md
gulp.src('build/monaco/README-npm.md') gulp.src('build/monaco/README-npm.md')
.pipe(es.through(function(data) { .pipe(es.through(function (data) {
this.emit('data', new File({ this.emit('data', new File({
path: data.path.replace(/README-npm\.md/, 'README.md'), path: data.path.replace(/README-npm\.md/, 'README.md'),
base: data.base, base: data.base,
@@ -124,10 +126,10 @@ gulp.task('editor-distro', ['clean-editor-distro', 'minify-editor', 'optimize-ed
// min folder // min folder
es.merge( es.merge(
gulp.src('out-editor-min/**/*') gulp.src('out-editor-min/**/*')
).pipe(filterStream(function(path) { ).pipe(filterStream(function (path) {
// no map files // no map files
return !/(\.js\.map$)|(nls\.metadata\.json$)|(bundleInfo\.json$)/.test(path); return !/(\.js\.map$)|(nls\.metadata\.json$)|(bundleInfo\.json$)/.test(path);
})).pipe(es.through(function(data) { })).pipe(es.through(function (data) {
// tweak the sourceMappingURL // tweak the sourceMappingURL
if (!/\.js$/.test(data.path)) { if (!/\.js$/.test(data.path)) {
this.emit('data', data); this.emit('data', data);
@@ -140,49 +142,50 @@ gulp.task('editor-distro', ['clean-editor-distro', 'minify-editor', 'optimize-ed
var newStr = '//# sourceMappingURL=' + relativePathToMap.replace(/\\/g, '/'); var newStr = '//# sourceMappingURL=' + relativePathToMap.replace(/\\/g, '/');
strContents = strContents.replace(/\/\/\# sourceMappingURL=[^ ]+$/, newStr); strContents = strContents.replace(/\/\/\# sourceMappingURL=[^ ]+$/, newStr);
data.contents = new Buffer(strContents); data.contents = Buffer.from(strContents);
this.emit('data', data); this.emit('data', data);
})).pipe(gulp.dest('out-monaco-editor-core/min')), })).pipe(gulp.dest('out-monaco-editor-core/min')),
// min-maps folder // min-maps folder
es.merge( es.merge(
gulp.src('out-editor-min/**/*') gulp.src('out-editor-min/**/*')
).pipe(filterStream(function(path) { ).pipe(filterStream(function (path) {
// no map files // no map files
return /\.js\.map$/.test(path); return /\.js\.map$/.test(path);
})).pipe(gulp.dest('out-monaco-editor-core/min-maps')) })).pipe(gulp.dest('out-monaco-editor-core/min-maps'))
); );
}); });
gulp.task('analyze-editor-distro', function() { gulp.task('analyze-editor-distro', function () {
// @ts-ignore Microsoft/TypeScript#21262 complains about a require of a JSON file
var bundleInfo = require('../out-editor/bundleInfo.json'); var bundleInfo = require('../out-editor/bundleInfo.json');
var graph = bundleInfo.graph; var graph = bundleInfo.graph;
var bundles = bundleInfo.bundles; var bundles = bundleInfo.bundles;
var inverseGraph = {}; var inverseGraph = {};
Object.keys(graph).forEach(function(module) { Object.keys(graph).forEach(function (module) {
var dependencies = graph[module]; var dependencies = graph[module];
dependencies.forEach(function(dep) { dependencies.forEach(function (dep) {
inverseGraph[dep] = inverseGraph[dep] || []; inverseGraph[dep] = inverseGraph[dep] || [];
inverseGraph[dep].push(module); inverseGraph[dep].push(module);
}); });
}); });
var detailed = {}; var detailed = {};
Object.keys(bundles).forEach(function(entryPoint) { Object.keys(bundles).forEach(function (entryPoint) {
var included = bundles[entryPoint]; var included = bundles[entryPoint];
var includedMap = {}; var includedMap = {};
included.forEach(function(included) { included.forEach(function (included) {
includedMap[included] = true; includedMap[included] = true;
}); });
var explanation = []; var explanation = [];
included.map(function(included) { included.map(function (included) {
if (included.indexOf('!') >= 0) { if (included.indexOf('!') >= 0) {
return; return;
} }
var reason = (inverseGraph[included]||[]).filter(function(mod) { var reason = (inverseGraph[included] || []).filter(function (mod) {
return !!includedMap[mod]; return !!includedMap[mod];
}); });
explanation.push({ explanation.push({
@@ -198,7 +201,7 @@ gulp.task('analyze-editor-distro', function() {
}); });
function filterStream(testFunc) { function filterStream(testFunc) {
return es.through(function(data) { return es.through(function (data) {
if (!testFunc(data.relative)) { if (!testFunc(data.relative)) {
return; return;
} }

View File

@@ -20,6 +20,7 @@ const sourcemaps = require('gulp-sourcemaps');
const nlsDev = require('vscode-nls-dev'); const nlsDev = require('vscode-nls-dev');
const root = path.dirname(__dirname); const root = path.dirname(__dirname);
const commit = util.getVersion(root); const commit = util.getVersion(root);
const i18n = require('./lib/i18n');
const extensionsPath = path.join(path.dirname(__dirname), 'extensions'); const extensionsPath = path.join(path.dirname(__dirname), 'extensions');
@@ -29,7 +30,8 @@ const compilations = glob.sync('**/tsconfig.json', {
}); });
const getBaseUrl = out => `https://ticino.blob.core.windows.net/sourcemaps/${commit}/${out}`; const getBaseUrl = out => `https://ticino.blob.core.windows.net/sourcemaps/${commit}/${out}`;
const languages = ['chs', 'cht', 'jpn', 'kor', 'deu', 'fra', 'esn', 'rus', 'ita'];
const languages = i18n.defaultLanguages.concat(process.env.VSCODE_QUALITY !== 'stable' ? i18n.extraLanguages : []);
const tasks = compilations.map(function (tsconfigFile) { const tasks = compilations.map(function (tsconfigFile) {
const absolutePath = path.join(extensionsPath, tsconfigFile); const absolutePath = path.join(extensionsPath, tsconfigFile);
@@ -55,9 +57,19 @@ const tasks = compilations.map(function (tsconfigFile) {
const srcBase = path.join(root, 'src'); const srcBase = path.join(root, 'src');
const src = path.join(srcBase, '**'); const src = path.join(srcBase, '**');
const out = path.join(root, 'out'); const out = path.join(root, 'out');
const i18n = path.join(__dirname, '..', 'i18n'); const i18nPath = path.join(__dirname, '..', 'i18n');
const baseUrl = getBaseUrl(out); const baseUrl = getBaseUrl(out);
let headerId, headerOut;
let index = relativeDirname.indexOf('/');
if (index < 0) {
headerId = 'vscode.' + relativeDirname;
headerOut = 'out';
} else {
headerId = 'vscode.' + relativeDirname.substr(0, index);
headerOut = relativeDirname.substr(index + 1) + '/out';
}
function createPipeline(build, emitError) { function createPipeline(build, emitError) {
const reporter = createReporter(); const reporter = createReporter();
@@ -82,7 +94,9 @@ const tasks = compilations.map(function (tsconfigFile) {
sourceRoot: '../src' sourceRoot: '../src'
})) }))
.pipe(tsFilter.restore) .pipe(tsFilter.restore)
.pipe(build ? nlsDev.createAdditionalLanguageFiles(languages, i18n, out) : es.through()) .pipe(build ? nlsDev.createAdditionalLanguageFiles(languages, i18nPath, out) : es.through())
.pipe(build ? nlsDev.bundleMetaDataFiles(headerId, headerOut) : es.through())
.pipe(build ? nlsDev.bundleLanguageFiles() : es.through())
.pipe(reporter.end(emitError)); .pipe(reporter.end(emitError));
return es.duplex(input, output); return es.duplex(input, output);
@@ -129,7 +143,7 @@ const tasks = compilations.map(function (tsconfigFile) {
const watchInput = watcher(src, srcOpts); const watchInput = watcher(src, srcOpts);
return watchInput return watchInput
.pipe(util.incremental(() => pipeline(true), input)) .pipe(util.incremental(() => pipeline(), input))
.pipe(gulp.dest(out)); .pipe(gulp.dest(out));
}); });

View File

@@ -12,7 +12,11 @@ const gulptslint = require('gulp-tslint');
const gulpeslint = require('gulp-eslint'); const gulpeslint = require('gulp-eslint');
const tsfmt = require('typescript-formatter'); const tsfmt = require('typescript-formatter');
const tslint = require('tslint'); const tslint = require('tslint');
const VinylFile = require('vinyl');
const vfs = require('vinyl-fs'); const vfs = require('vinyl-fs');
const path = require('path');
const fs = require('fs');
const pall = require('p-all');
/** /**
* Hygiene works by creating cascading subsets of all our files and * Hygiene works by creating cascading subsets of all our files and
@@ -29,55 +33,56 @@ const all = [
'extensions/**/*', 'extensions/**/*',
'scripts/**/*', 'scripts/**/*',
'src/**/*', 'src/**/*',
'test/**/*' 'test/**/*',
]; '!**/node_modules/**'
const eolFilter = [
'**',
'!ThirdPartyNotices.txt',
'!LICENSE.txt',
'!extensions/**/out/**',
'!test/smoke/out/**',
'!**/node_modules/**',
'!**/fixtures/**',
'!**/*.{svg,exe,png,bmp,scpt,bat,cmd,cur,ttf,woff,eot}',
'!build/{lib,tslintRules}/**/*.js',
'!build/monaco/**',
'!build/win32/**',
'!build/**/*.sh',
'!build/tfs/**/*.js',
'!**/Dockerfile'
]; ];
const indentationFilter = [ const indentationFilter = [
'**', '**',
// except specific files
'!ThirdPartyNotices.txt', '!ThirdPartyNotices.txt',
'!**/*.md', '!LICENSE.txt',
'!**/*.ps1', '!src/vs/nls.js',
'!**/*.template', '!src/vs/css.js',
'!**/*.yaml', '!src/vs/loader.js',
'!**/*.yml', '!src/vs/base/common/marked/raw.marked.js',
'!**/yarn.lock', '!src/vs/base/common/winjs.base.raw.js',
'!**/lib/**', '!src/vs/base/node/terminateProcess.sh',
'!extensions/**/*.d.ts', '!src/vs/base/node/ps-win.ps1',
'!src/typings/**/*.d.ts',
'!src/vs/*/**/*.d.ts',
'!**/*.d.ts.recipe',
'!test/assert.js', '!test/assert.js',
// except specific folders
'!test/smoke/out/**',
'!extensions/vscode-api-tests/testWorkspace/**',
'!extensions/vscode-api-tests/testWorkspace2/**',
'!build/monaco/**',
'!build/win32/**',
// except multiple specific files
'!**/package.json', '!**/package.json',
'!**/yarn.lock',
// except multiple specific folders
'!**/octicons/**', '!**/octicons/**',
'!**/vs/base/common/marked/raw.marked.js', '!**/fixtures/**',
'!**/vs/base/common/winjs.base.raw.js', '!**/lib/**',
'!**/vs/base/node/terminateProcess.sh', '!extensions/**/out/**',
'!**/vs/base/node/ps-win.ps1',
'!**/vs/nls.js',
'!**/vs/css.js',
'!**/vs/loader.js',
'!extensions/**/snippets/**', '!extensions/**/snippets/**',
'!extensions/**/syntaxes/**', '!extensions/**/syntaxes/**',
'!extensions/**/themes/**', '!extensions/**/themes/**',
'!extensions/**/colorize-fixtures/**', '!extensions/**/colorize-fixtures/**',
'!extensions/vscode-api-tests/testWorkspace/**'
// except specific file types
'!src/vs/*/**/*.d.ts',
'!src/typings/**/*.d.ts',
'!extensions/**/*.d.ts',
'!**/*.{svg,exe,png,bmp,scpt,bat,cmd,cur,ttf,woff,eot,md,ps1,template,yaml,yml,d.ts.recipe}',
'!build/{lib,tslintRules}/**/*.js',
'!build/**/*.sh',
'!build/tfs/**/*.js',
'!**/Dockerfile',
'!extensions/markdown/media/*.js'
]; ];
const copyrightFilter = [ const copyrightFilter = [
@@ -95,6 +100,7 @@ const copyrightFilter = [
'!**/*.xpm', '!**/*.xpm',
'!**/*.opts', '!**/*.opts',
'!**/*.disabled', '!**/*.disabled',
'!**/*.code-workspace',
'!build/**/*.init', '!build/**/*.init',
'!resources/linux/snap/snapcraft.yaml', '!resources/linux/snap/snapcraft.yaml',
'!resources/win32/bin/code.js', '!resources/win32/bin/code.js',
@@ -124,6 +130,7 @@ const tslintFilter = [
'!**/node_modules/**', '!**/node_modules/**',
'!extensions/typescript/test/colorize-fixtures/**', '!extensions/typescript/test/colorize-fixtures/**',
'!extensions/vscode-api-tests/testWorkspace/**', '!extensions/vscode-api-tests/testWorkspace/**',
'!extensions/vscode-api-tests/testWorkspace2/**',
'!extensions/**/*.test.ts', '!extensions/**/*.test.ts',
'!extensions/html/server/lib/jquery.d.ts' '!extensions/html/server/lib/jquery.d.ts'
]; ];
@@ -144,31 +151,23 @@ gulp.task('eslint', () => {
}); });
gulp.task('tslint', () => { gulp.task('tslint', () => {
// {{SQL CARBON EDIT}}
const options = { emitError: false }; const options = { emitError: false };
return vfs.src(all, { base: '.', follow: true, allowEmpty: true }) return vfs.src(all, { base: '.', follow: true, allowEmpty: true })
.pipe(filter(tslintFilter)) .pipe(filter(tslintFilter))
.pipe(gulptslint({ rulesDirectory: 'build/lib/tslint' })) .pipe(gulptslint.default({ rulesDirectory: 'build/lib/tslint' }))
.pipe(gulptslint.report(options)); .pipe(gulptslint.default.report(options));
}); });
const hygiene = exports.hygiene = (some, options) => { function hygiene(some) {
options = options || {};
let errorCount = 0; let errorCount = 0;
const eol = es.through(function (file) {
if (/\r\n?/g.test(file.contents.toString('utf8'))) {
console.error(file.relative + ': Bad EOL found');
errorCount++;
}
this.emit('data', file);
});
const indentation = es.through(function (file) { const indentation = es.through(function (file) {
file.contents const lines = file.contents.toString('utf8').split(/\r\n|\r|\n/);
.toString('utf8') file.__lines = lines;
.split(/\r\n|\r|\n/)
lines
.forEach((line, i) => { .forEach((line, i) => {
if (/^\s*$/.test(line)) { if (/^\s*$/.test(line)) {
// empty or whitespace lines are OK // empty or whitespace lines are OK
@@ -186,9 +185,14 @@ const hygiene = exports.hygiene = (some, options) => {
}); });
const copyrights = es.through(function (file) { const copyrights = es.through(function (file) {
if (file.contents.toString('utf8').indexOf(copyrightHeader) !== 0) { const lines = file.__lines;
console.error(file.relative + ': Missing or bad copyright statement');
errorCount++; for (let i = 0; i < copyrightHeaderLines.length; i++) {
if (lines[i] !== copyrightHeaderLines[i]) {
console.error(file.relative + ': Missing or bad copyright statement');
errorCount++;
break;
}
} }
this.emit('data', file); this.emit('data', file);
@@ -196,12 +200,20 @@ const hygiene = exports.hygiene = (some, options) => {
const formatting = es.map(function (file, cb) { const formatting = es.map(function (file, cb) {
tsfmt.processString(file.path, file.contents.toString('utf8'), { tsfmt.processString(file.path, file.contents.toString('utf8'), {
verify: true, verify: false,
tsfmt: true, tsfmt: true,
// verbose: true // verbose: true
// keep checkJS happy
editorconfig: undefined,
replace: undefined,
tsconfig: undefined,
tslint: undefined
}).then(result => { }).then(result => {
if (result.error) { let original = result.src.replace(/\r\n/gm, '\n');
console.error(result.message); let formatted = result.dest.replace(/\r\n/gm, '\n');
if (original !== formatted) {
console.error('File not formatted:', file.relative);
errorCount++; errorCount++;
} }
cb(null, file); cb(null, file);
@@ -211,43 +223,31 @@ const hygiene = exports.hygiene = (some, options) => {
}); });
}); });
function reportFailures(failures) { const tslintConfiguration = tslint.Configuration.findConfiguration('tslint.json', '.');
failures.forEach(failure => { const tslintOptions = { fix: false, formatter: 'json' };
const name = failure.name || failure.fileName; const tsLinter = new tslint.Linter(tslintOptions);
const position = failure.startPosition;
const line = position.lineAndCharacter ? position.lineAndCharacter.line : position.line;
const character = position.lineAndCharacter ? position.lineAndCharacter.character : position.character;
// console.error(`${name}:${line + 1}:${character + 1}:${failure.failure}`);
});
}
const tsl = es.through(function (file) { const tsl = es.through(function (file) {
const configuration = tslint.Configuration.findConfiguration(null, '.');
const options = { formatter: 'json', rulesDirectory: 'build/lib/tslint' };
const contents = file.contents.toString('utf8'); const contents = file.contents.toString('utf8');
const linter = new tslint.Linter(options); tsLinter.lint(file.relative, contents, tslintConfiguration.results);
linter.lint(file.relative, contents, configuration.results);
const result = linter.getResult();
if (result.failures.length > 0) {
reportFailures(result.failures);
errorCount += result.failures.length;
}
this.emit('data', file); this.emit('data', file);
}); });
const result = vfs.src(some || all, { base: '.', follow: true, allowEmpty: true }) let input;
if (Array.isArray(some) || typeof some === 'string' || !some) {
input = vfs.src(some || all, { base: '.', follow: true, allowEmpty: true });
} else {
input = some;
}
const result = input
.pipe(filter(f => !f.stat.isDirectory())) .pipe(filter(f => !f.stat.isDirectory()))
.pipe(filter(eolFilter))
// {{SQL CARBON EDIT}}
//.pipe(options.skipEOL ? es.through() : eol)
.pipe(filter(indentationFilter)) .pipe(filter(indentationFilter))
.pipe(indentation) .pipe(indentation)
.pipe(filter(copyrightFilter)) .pipe(filter(copyrightFilter));
// {{SQL CARBON EDIT}} // {{SQL CARBON EDIT}}
//.pipe(copyrights); // .pipe(copyrights);
const typescript = result const typescript = result
.pipe(filter(tslintFilter)) .pipe(filter(tslintFilter))
@@ -257,23 +257,52 @@ const hygiene = exports.hygiene = (some, options) => {
const javascript = result const javascript = result
.pipe(filter(eslintFilter)) .pipe(filter(eslintFilter))
.pipe(gulpeslint('src/.eslintrc')) .pipe(gulpeslint('src/.eslintrc'))
.pipe(gulpeslint.formatEach('compact')) .pipe(gulpeslint.formatEach('compact'));
// {{SQL CARBON EDIT}} // {{SQL CARBON EDIT}}
// .pipe(gulpeslint.failAfterError()); // .pipe(gulpeslint.failAfterError());
return es.merge(typescript, javascript) let count = 0;
.pipe(es.through(null, function () { return es.merge(typescript, javascript)
// {{SQL CARBON EDIT}} .pipe(es.through(function (data) {
// if (errorCount > 0) { // {{SQL CARBON EDIT}}
// this.emit('error', 'Hygiene failed with ' + errorCount + ' errors. Check \'build/gulpfile.hygiene.js\'.'); this.emit('end');
// } else { }));
// this.emit('end'); }
// }
this.emit('end');
}));
};
gulp.task('hygiene', () => hygiene('')); function createGitIndexVinyls(paths) {
const cp = require('child_process');
const repositoryPath = process.cwd();
const fns = paths.map(relativePath => () => new Promise((c, e) => {
const fullPath = path.join(repositoryPath, relativePath);
fs.stat(fullPath, (err, stat) => {
if (err && err.code === 'ENOENT') { // ignore deletions
return c(null);
} else if (err) {
return e(err);
}
cp.exec(`git show :${relativePath}`, { maxBuffer: 2000 * 1024, encoding: 'buffer' }, (err, out) => {
if (err) {
return e(err);
}
c(new VinylFile({
path: fullPath,
base: repositoryPath,
contents: out,
stat
}));
});
});
}));
return pall(fns, { concurrency: 4 })
.then(r => r.filter(p => !!p));
}
gulp.task('hygiene', () => hygiene());
// this allows us to run hygiene as a git pre-commit hook // this allows us to run hygiene as a git pre-commit hook
if (require.main === module) { if (require.main === module) {
@@ -284,22 +313,19 @@ if (require.main === module) {
process.exit(1); process.exit(1);
}); });
cp.exec('git config core.autocrlf', (err, out) => { if (process.argv.length > 2) {
const skipEOL = out.trim() === 'true'; hygiene(process.argv.slice(2)).on('error', err => {
console.error();
if (process.argv.length > 2) { console.error(err);
return hygiene(process.argv.slice(2), { skipEOL: skipEOL }).on('error', err => { process.exit(1);
console.error(); });
console.error(err); } else {
process.exit(1);
});
}
cp.exec('git diff --cached --name-only', { maxBuffer: 2000 * 1024 }, (err, out) => { cp.exec('git diff --cached --name-only', { maxBuffer: 2000 * 1024 }, (err, out) => {
if (err) { if (err) {
console.error(); console.error();
console.error(err); console.error(err);
process.exit(1); process.exit(1);
return;
} }
const some = out const some = out
@@ -307,12 +333,18 @@ if (require.main === module) {
.filter(l => !!l); .filter(l => !!l);
if (some.length > 0) { if (some.length > 0) {
hygiene(some, { skipEOL: skipEOL }).on('error', err => { console.log('Reading git index versions...');
console.error();
console.error(err); createGitIndexVinyls(some)
process.exit(1); .then(vinyls => new Promise((c, e) => hygiene(es.readArray(vinyls))
}); .on('end', () => c())
.on('error', e)))
.catch(err => {
console.error();
console.error(err);
process.exit(1);
});
} }
}); });
}); }
} }

View File

@@ -6,9 +6,21 @@
'use strict'; 'use strict';
const gulp = require('gulp'); const gulp = require('gulp');
const json = require('gulp-json-editor');
const buffer = require('gulp-buffer');
const filter = require('gulp-filter');
const es = require('event-stream');
const util = require('./lib/util');
const remote = require('gulp-remote-src');
const zip = require('gulp-vinyl-zip');
const assign = require('object-assign');
// {{SQL CARBON EDIT}} // {{SQL CARBON EDIT}}
const jeditor = require('gulp-json-editor'); const jeditor = require('gulp-json-editor');
// @ts-ignore Microsoft/TypeScript#21262 complains about a require of a JSON file
const pkg = require('../package.json');
gulp.task('mixin', function () { gulp.task('mixin', function () {
// {{SQL CARBON EDIT}} // {{SQL CARBON EDIT}}
const updateUrl = process.env['SQLOPS_UPDATEURL']; const updateUrl = process.env['SQLOPS_UPDATEURL'];

View File

@@ -27,18 +27,22 @@ const common = require('./lib/optimize');
const nlsDev = require('vscode-nls-dev'); const nlsDev = require('vscode-nls-dev');
const root = path.dirname(__dirname); const root = path.dirname(__dirname);
const commit = util.getVersion(root); const commit = util.getVersion(root);
// @ts-ignore Microsoft/TypeScript#21262 complains about a require of a JSON file
const packageJson = require('../package.json'); const packageJson = require('../package.json');
// @ts-ignore Microsoft/TypeScript#21262 complains about a require of a JSON file
const product = require('../product.json'); const product = require('../product.json');
const crypto = require('crypto'); const crypto = require('crypto');
const i18n = require('./lib/i18n'); const i18n = require('./lib/i18n');
// {{SQL CARBON EDIT}}
const serviceDownloader = require('service-downloader').ServiceDownloadProvider; const serviceDownloader = require('service-downloader').ServiceDownloadProvider;
const platformInfo = require('service-downloader/out/platform').PlatformInformation; const platformInfo = require('service-downloader/out/platform').PlatformInformation;
const glob = require('glob'); const glob = require('glob');
const deps = require('./dependencies'); const deps = require('./dependencies');
const getElectronVersion = require('./lib/electron').getElectronVersion; const getElectronVersion = require('./lib/electron').getElectronVersion;
const createAsar = require('./lib/asar').createAsar;
const productionDependencies = deps.getProductionDependencies(path.dirname(__dirname)); const productionDependencies = deps.getProductionDependencies(path.dirname(__dirname));
// @ts-ignore
// {{SQL CARBON EDIT}} // {{SQL CARBON EDIT}}
var del = require('del'); var del = require('del');
const extensionsRoot = path.join(root, 'extensions'); const extensionsRoot = path.join(root, 'extensions');
@@ -56,16 +60,16 @@ const nodeModules = [
.concat(_.uniq(productionDependencies.map(d => d.name))) .concat(_.uniq(productionDependencies.map(d => d.name)))
.concat(baseModules); .concat(baseModules);
// Build
const builtInExtensions = [ // Build
{ name: 'ms-vscode.node-debug', version: '1.19.8' }, // @ts-ignore Microsoft/TypeScript#21262 complains about a require of a JSON file
{ name: 'ms-vscode.node-debug2', version: '1.19.4' } const builtInExtensions = require('./builtInExtensions.json');
];
const excludedExtensions = [ const excludedExtensions = [
'vscode-api-tests', 'vscode-api-tests',
'vscode-colorize-tests' 'vscode-colorize-tests',
'ms-vscode.node-debug',
'ms-vscode.node-debug2',
]; ];
// {{SQL CARBON EDIT}} // {{SQL CARBON EDIT}}
@@ -104,7 +108,8 @@ const vscodeResources = [
'out-build/vs/workbench/parts/welcome/walkThrough/**/*.md', 'out-build/vs/workbench/parts/welcome/walkThrough/**/*.md',
'out-build/vs/workbench/services/files/**/*.exe', 'out-build/vs/workbench/services/files/**/*.exe',
'out-build/vs/workbench/services/files/**/*.md', 'out-build/vs/workbench/services/files/**/*.md',
'out-build/vs/code/electron-browser/sharedProcess.js', 'out-build/vs/code/electron-browser/sharedProcess/sharedProcess.js',
'out-build/vs/code/electron-browser/issue/issueReporter.js',
// {{SQL CARBON EDIT}} // {{SQL CARBON EDIT}}
'out-build/sql/workbench/electron-browser/splashscreen/*', 'out-build/sql/workbench/electron-browser/splashscreen/*',
'out-build/sql/**/*.{svg,png,cur,html}', 'out-build/sql/**/*.{svg,png,cur,html}',
@@ -134,10 +139,7 @@ const BUNDLED_FILE_HEADER = [
' *--------------------------------------------------------*/' ' *--------------------------------------------------------*/'
].join('\n'); ].join('\n');
var languages = ['chs', 'cht', 'jpn', 'kor', 'deu', 'fra', 'esn', 'rus', 'ita']; const languages = i18n.defaultLanguages.concat([]); // i18n.defaultLanguages.concat(process.env.VSCODE_QUALITY !== 'stable' ? i18n.extraLanguages : []);
if (process.env.VSCODE_QUALITY !== 'stable') {
languages = languages.concat(['ptb', 'hun', 'trk']); // Add languages requested by the community to non-stable builds
}
gulp.task('clean-optimized-vscode', util.rimraf('out-vscode')); gulp.task('clean-optimized-vscode', util.rimraf('out-vscode'));
gulp.task('optimize-vscode', ['clean-optimized-vscode', 'compile-build', 'compile-extensions-build'], common.optimizeTask({ gulp.task('optimize-vscode', ['clean-optimized-vscode', 'compile-build', 'compile-extensions-build'], common.optimizeTask({
@@ -147,7 +149,8 @@ gulp.task('optimize-vscode', ['clean-optimized-vscode', 'compile-build', 'compil
loaderConfig: common.loaderConfig(nodeModules), loaderConfig: common.loaderConfig(nodeModules),
header: BUNDLED_FILE_HEADER, header: BUNDLED_FILE_HEADER,
out: 'out-vscode', out: 'out-vscode',
languages: languages languages: languages,
bundleInfo: undefined
})); }));
@@ -169,7 +172,7 @@ const config = {
version: getElectronVersion(), version: getElectronVersion(),
productAppName: product.nameLong, productAppName: product.nameLong,
companyName: 'Microsoft Corporation', companyName: 'Microsoft Corporation',
copyright: 'Copyright (C) 2017 Microsoft. All rights reserved', copyright: 'Copyright (C) 2018 Microsoft. All rights reserved',
darwinIcon: 'resources/darwin/code.icns', darwinIcon: 'resources/darwin/code.icns',
darwinBundleIdentifier: product.darwinBundleIdentifier, darwinBundleIdentifier: product.darwinBundleIdentifier,
darwinApplicationCategoryType: 'public.app-category.developer-tools', darwinApplicationCategoryType: 'public.app-category.developer-tools',
@@ -188,7 +191,7 @@ const config = {
name: product.nameLong, name: product.nameLong,
urlSchemes: [product.urlProtocol] urlSchemes: [product.urlProtocol]
}], }],
darwinCredits: darwinCreditsTemplate ? new Buffer(darwinCreditsTemplate({ commit: commit, date: new Date().toISOString() })) : void 0, darwinCredits: darwinCreditsTemplate ? Buffer.from(darwinCreditsTemplate({ commit: commit, date: new Date().toISOString() })) : void 0,
linuxExecutableName: product.applicationName, linuxExecutableName: product.applicationName,
winIcon: 'resources/win32/code.ico', winIcon: 'resources/win32/code.ico',
token: process.env['VSCODE_MIXIN_PASSWORD'] || process.env['GITHUB_TOKEN'] || void 0, token: process.env['VSCODE_MIXIN_PASSWORD'] || process.env['GITHUB_TOKEN'] || void 0,
@@ -328,12 +331,10 @@ function packageTask(platform, arch, opts) {
.pipe(util.cleanNodeModule('account-provider-azure', ['node_modules/date-utils/doc/**', 'node_modules/adal_node/node_modules/**'], undefined)) .pipe(util.cleanNodeModule('account-provider-azure', ['node_modules/date-utils/doc/**', 'node_modules/adal_node/node_modules/**'], undefined))
.pipe(util.cleanNodeModule('typescript', ['**/**'], undefined)); .pipe(util.cleanNodeModule('typescript', ['**/**'], undefined));
const sources = es.merge(src, localExtensions, localExtensionDependencies) const sources = es.merge(src, localExtensions, localExtensionDependencies)
.pipe(util.setExecutableBit(['**/*.sh'])) .pipe(util.setExecutableBit(['**/*.sh']))
.pipe(filter(['**', .pipe(filter(['**', '!**/*.js.map']));
'!**/*.js.map',
'!extensions/**/node_modules/**/{test, tests}/**',
'!extensions/**/node_modules/**/test.js']));
let version = packageJson.version; let version = packageJson.version;
const quality = product.quality; const quality = product.quality;
@@ -357,7 +358,7 @@ function packageTask(platform, arch, opts) {
// TODO the API should be copied to `out` during compile, not here // TODO the API should be copied to `out` during compile, not here
const api = gulp.src('src/vs/vscode.d.ts').pipe(rename('out/vs/vscode.d.ts')); const api = gulp.src('src/vs/vscode.d.ts').pipe(rename('out/vs/vscode.d.ts'));
// {{SQL CARBON EDIT}} // {{SQL CARBON EDIT}}
const dataApi = gulp.src('src/vs/data.d.ts').pipe(rename('out/sql/data.d.ts')); const dataApi = gulp.src('src/vs/data.d.ts').pipe(rename('out/sql/data.d.ts'));
const depsSrc = [ const depsSrc = [
@@ -371,6 +372,7 @@ function packageTask(platform, arch, opts) {
.pipe(util.cleanNodeModule('oniguruma', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['**/*.node', 'src/*.js'])) .pipe(util.cleanNodeModule('oniguruma', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['**/*.node', 'src/*.js']))
.pipe(util.cleanNodeModule('windows-mutex', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node'])) .pipe(util.cleanNodeModule('windows-mutex', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node']))
.pipe(util.cleanNodeModule('native-keymap', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['**/*.node'])) .pipe(util.cleanNodeModule('native-keymap', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['**/*.node']))
.pipe(util.cleanNodeModule('native-is-elevated', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['**/*.node']))
.pipe(util.cleanNodeModule('native-watchdog', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node'])) .pipe(util.cleanNodeModule('native-watchdog', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node']))
.pipe(util.cleanNodeModule('spdlog', ['binding.gyp', 'build/**', 'deps/**', 'src/**', 'test/**'], ['**/*.node'])) .pipe(util.cleanNodeModule('spdlog', ['binding.gyp', 'build/**', 'deps/**', 'src/**', 'test/**'], ['**/*.node']))
.pipe(util.cleanNodeModule('jschardet', ['dist/**'])) .pipe(util.cleanNodeModule('jschardet', ['dist/**']))
@@ -378,18 +380,27 @@ function packageTask(platform, arch, opts) {
.pipe(util.cleanNodeModule('windows-process-tree', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node'])) .pipe(util.cleanNodeModule('windows-process-tree', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node']))
.pipe(util.cleanNodeModule('gc-signals', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['**/*.node', 'src/index.js'])) .pipe(util.cleanNodeModule('gc-signals', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['**/*.node', 'src/index.js']))
.pipe(util.cleanNodeModule('keytar', ['binding.gyp', 'build/**', 'src/**', 'script/**', 'node_modules/**'], ['**/*.node'])) .pipe(util.cleanNodeModule('keytar', ['binding.gyp', 'build/**', 'src/**', 'script/**', 'node_modules/**'], ['**/*.node']))
.pipe(util.cleanNodeModule('node-pty', ['binding.gyp', 'build/**', 'src/**', 'tools/**'], ['build/Release/*.exe', 'build/Release/*.dll', 'build/Release/*.node']))
// {{SQL CARBON EDIT}} // {{SQL CARBON EDIT}}
.pipe(util.cleanNodeModule('node-pty', ['binding.gyp', 'build/**', 'src/**', 'tools/**'], ['build/Release/*.node', 'build/Release/*.dll', 'build/Release/*.exe']))
.pipe(util.cleanNodeModule('chart.js', ['node_modules/**'], undefined)) .pipe(util.cleanNodeModule('chart.js', ['node_modules/**'], undefined))
.pipe(util.cleanNodeModule('emmet', ['node_modules/**'], undefined)) .pipe(util.cleanNodeModule('emmet', ['node_modules/**'], undefined))
.pipe(util.cleanNodeModule('pty.js', ['build/**'], ['build/Release/**'])) .pipe(util.cleanNodeModule('pty.js', ['build/**'], ['build/Release/**']))
.pipe(util.cleanNodeModule('jquery-ui', ['external/**', 'demos/**'], undefined)) .pipe(util.cleanNodeModule('jquery-ui', ['external/**', 'demos/**'], undefined))
.pipe(util.cleanNodeModule('core-js', ['**/**'], undefined)) .pipe(util.cleanNodeModule('core-js', ['**/**'], undefined))
.pipe(util.cleanNodeModule('slickgrid', ['node_modules/**', 'examples/**'], undefined)) .pipe(util.cleanNodeModule('slickgrid', ['node_modules/**', 'examples/**'], undefined))
.pipe(util.cleanNodeModule('nsfw', ['binding.gyp', 'build/**', 'src/**', 'openpa/**', 'includes/**'], ['**/*.node', '**/*.a'])) .pipe(util.cleanNodeModule('nsfw', ['binding.gyp', 'build/**', 'src/**', 'openpa/**', 'includes/**'], ['**/*.node', '**/*.a']))
.pipe(util.cleanNodeModule('vsda', ['binding.gyp', 'README.md', 'build/**', '*.bat', '*.sh', '*.cpp', '*.h'], ['build/Release/vsda.node'])); .pipe(util.cleanNodeModule('vsda', ['binding.gyp', 'README.md', 'build/**', '*.bat', '*.sh', '*.cpp', '*.h'], ['build/Release/vsda.node']))
.pipe(createAsar(path.join(process.cwd(), 'node_modules'), ['**/*.node', '**/vscode-ripgrep/bin/*', '**/node-pty/build/Release/*'], 'app/node_modules.asar'));
// {{SQL CARBON EDIT}}
let copiedModules = gulp.src([
'node_modules/jquery/**/*.*',
'node_modules/reflect-metadata/**/*.*',
'node_modules/slickgrid/**/*.*',
'node_modules/underscore/**/*.*',
'node_modules/zone.js/**/*.*',
'node_modules/chart.js/**/*.*'
], { base: '.', dot: true });
let all = es.merge( let all = es.merge(
packageJsonStream, packageJsonStream,
@@ -397,7 +408,8 @@ function packageTask(platform, arch, opts) {
license, license,
watermark, watermark,
api, api,
// {{SQL CARBON EDIT}} // {{SQL CARBON EDIT}}
copiedModules,
dataApi, dataApi,
sources, sources,
deps deps
@@ -468,25 +480,21 @@ gulp.task('vscode-linux-x64-min', ['minify-vscode', 'clean-vscode-linux-x64'], p
gulp.task('vscode-linux-arm-min', ['minify-vscode', 'clean-vscode-linux-arm'], packageTask('linux', 'arm', { minified: true })); gulp.task('vscode-linux-arm-min', ['minify-vscode', 'clean-vscode-linux-arm'], packageTask('linux', 'arm', { minified: true }));
// Transifex Localizations // Transifex Localizations
const vscodeLanguages = [
'zh-hans', const innoSetupConfig = {
'zh-hant', 'zh-cn': { codePage: 'CP936', defaultInfo: { name: 'Simplified Chinese', id: '$0804', } },
'ja', 'zh-tw': { codePage: 'CP950', defaultInfo: { name: 'Traditional Chinese', id: '$0404' } },
'ko', 'ko': { codePage: 'CP949', defaultInfo: { name: 'Korean', id: '$0412' } },
'de', 'ja': { codePage: 'CP932' },
'fr', 'de': { codePage: 'CP1252' },
'es', 'fr': { codePage: 'CP1252' },
'ru', 'es': { codePage: 'CP1252' },
'it', 'ru': { codePage: 'CP1251' },
'pt-br', 'it': { codePage: 'CP1252' },
'hu', 'pt-br': { codePage: 'CP1252' },
'tr' 'hu': { codePage: 'CP1250' },
]; 'tr': { codePage: 'CP1254' }
const setupDefaultLanguages = [ };
'zh-hans',
'zh-hant',
'ko'
];
const apiHostname = process.env.TRANSIFEX_API_URL; const apiHostname = process.env.TRANSIFEX_API_URL;
const apiName = process.env.TRANSIFEX_API_NAME; const apiName = process.env.TRANSIFEX_API_NAME;
@@ -494,27 +502,48 @@ const apiToken = process.env.TRANSIFEX_API_TOKEN;
gulp.task('vscode-translations-push', ['optimize-vscode'], function () { gulp.task('vscode-translations-push', ['optimize-vscode'], function () {
const pathToMetadata = './out-vscode/nls.metadata.json'; const pathToMetadata = './out-vscode/nls.metadata.json';
const pathToExtensions = './extensions/**/*.nls.json'; const pathToExtensions = './extensions/*';
const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}'; const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}';
return es.merge( return es.merge(
gulp.src(pathToMetadata).pipe(i18n.prepareXlfFiles()), gulp.src(pathToMetadata).pipe(i18n.createXlfFilesForCoreBundle()),
gulp.src(pathToSetup).pipe(i18n.prepareXlfFiles()), gulp.src(pathToSetup).pipe(i18n.createXlfFilesForIsl()),
gulp.src(pathToExtensions).pipe(i18n.prepareXlfFiles('vscode-extensions')) gulp.src(pathToExtensions).pipe(i18n.createXlfFilesForExtensions())
).pipe(i18n.findObsoleteResources(apiHostname, apiName, apiToken)
).pipe(i18n.pushXlfFiles(apiHostname, apiName, apiToken)); ).pipe(i18n.pushXlfFiles(apiHostname, apiName, apiToken));
}); });
gulp.task('vscode-translations-pull', function () { gulp.task('vscode-translations-push-test', ['optimize-vscode'], function () {
const pathToMetadata = './out-vscode/nls.metadata.json';
const pathToExtensions = './extensions/*';
const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}';
return es.merge( return es.merge(
i18n.pullXlfFiles('vscode-editor', apiHostname, apiName, apiToken, vscodeLanguages), gulp.src(pathToMetadata).pipe(i18n.createXlfFilesForCoreBundle()),
i18n.pullXlfFiles('vscode-workbench', apiHostname, apiName, apiToken, vscodeLanguages), gulp.src(pathToSetup).pipe(i18n.createXlfFilesForIsl()),
i18n.pullXlfFiles('vscode-extensions', apiHostname, apiName, apiToken, vscodeLanguages), gulp.src(pathToExtensions).pipe(i18n.createXlfFilesForExtensions())
i18n.pullXlfFiles('vscode-setup', apiHostname, apiName, apiToken, setupDefaultLanguages) ).pipe(i18n.findObsoleteResources(apiHostname, apiName, apiToken)
).pipe(vfs.dest('../vscode-localization')); ).pipe(vfs.dest('../vscode-transifex-input'));
});
gulp.task('vscode-translations-pull', function () {
[...i18n.defaultLanguages, ...i18n.extraLanguages].forEach(language => {
i18n.pullCoreAndExtensionsXlfFiles(apiHostname, apiName, apiToken, language).pipe(vfs.dest(`../vscode-localization/${language.id}/build`));
let includeDefault = !!innoSetupConfig[language.id].defaultInfo;
i18n.pullSetupXlfFiles(apiHostname, apiName, apiToken, language, includeDefault).pipe(vfs.dest(`../vscode-localization/${language.id}/setup`));
});
}); });
gulp.task('vscode-translations-import', function () { gulp.task('vscode-translations-import', function () {
return gulp.src('../vscode-localization/**/*.xlf').pipe(i18n.prepareJsonFiles()).pipe(vfs.dest('./i18n')); [...i18n.defaultLanguages, ...i18n.extraLanguages].forEach(language => {
gulp.src(`../vscode-localization/${language.id}/build/*/*.xlf`)
.pipe(i18n.prepareI18nFiles())
.pipe(vfs.dest(`./i18n/${language.folderName}`));
gulp.src(`../vscode-localization/${language.id}/setup/*/*.xlf`)
.pipe(i18n.prepareIslFiles(language, innoSetupConfig[language.id]))
.pipe(vfs.dest(`./build/win32/i18n`));
});
}); });
// Sourcemaps // Sourcemaps
@@ -540,7 +569,8 @@ gulp.task('upload-vscode-sourcemaps', ['minify-vscode'], () => {
const allConfigDetailsPath = path.join(os.tmpdir(), 'configuration.json'); const allConfigDetailsPath = path.join(os.tmpdir(), 'configuration.json');
gulp.task('upload-vscode-configuration', ['generate-vscode-configuration'], () => { gulp.task('upload-vscode-configuration', ['generate-vscode-configuration'], () => {
const branch = process.env.BUILD_SOURCEBRANCH; const branch = process.env.BUILD_SOURCEBRANCH;
if (!branch.endsWith('/master') && branch.indexOf('/release/') < 0) {
if (!/\/master$/.test(branch) && branch.indexOf('/release/') < 0) {
console.log(`Only runs on master and release branches, not ${branch}`); console.log(`Only runs on master and release branches, not ${branch}`);
return; return;
} }
@@ -635,6 +665,7 @@ function versionStringToNumber(versionStr) {
return parseInt(match[1], 10) * 1e4 + parseInt(match[2], 10) * 1e2 + parseInt(match[3], 10); return parseInt(match[1], 10) * 1e4 + parseInt(match[2], 10) * 1e2 + parseInt(match[3], 10);
} }
// This task is only run for the MacOS build
gulp.task('generate-vscode-configuration', () => { gulp.task('generate-vscode-configuration', () => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const buildDir = process.env['AGENT_BUILDDIRECTORY']; const buildDir = process.env['AGENT_BUILDDIRECTORY'];
@@ -644,7 +675,8 @@ gulp.task('generate-vscode-configuration', () => {
const userDataDir = path.join(os.tmpdir(), 'tmpuserdata'); const userDataDir = path.join(os.tmpdir(), 'tmpuserdata');
const extensionsDir = path.join(os.tmpdir(), 'tmpextdir'); const extensionsDir = path.join(os.tmpdir(), 'tmpextdir');
const appPath = path.join(buildDir, 'VSCode-darwin/Visual\\ Studio\\ Code\\ -\\ Insiders.app/Contents/Resources/app/bin/code'); const appName = process.env.VSCODE_QUALITY === 'insider' ? 'Visual\\ Studio\\ Code\\ -\\ Insiders.app' : 'Visual\\ Studio\\ Code.app';
const appPath = path.join(buildDir, `VSCode-darwin/${appName}/Contents/Resources/app/bin/code`);
const codeProc = cp.exec(`${appPath} --export-default-configuration='${allConfigDetailsPath}' --wait --user-data-dir='${userDataDir}' --extensions-dir='${extensionsDir}'`); const codeProc = cp.exec(`${appPath} --export-default-configuration='${allConfigDetailsPath}' --wait --user-data-dir='${userDataDir}' --extensions-dir='${extensionsDir}'`);
const timer = setTimeout(() => { const timer = setTimeout(() => {
@@ -694,3 +726,4 @@ function installService() {
gulp.task('install-sqltoolsservice', () => { gulp.task('install-sqltoolsservice', () => {
return installService(); return installService();
}); });

View File

@@ -12,9 +12,12 @@ const shell = require('gulp-shell');
const es = require('event-stream'); const es = require('event-stream');
const vfs = require('vinyl-fs'); const vfs = require('vinyl-fs');
const util = require('./lib/util'); const util = require('./lib/util');
// @ts-ignore Microsoft/TypeScript#21262 complains about a require of a JSON file
const packageJson = require('../package.json'); const packageJson = require('../package.json');
// @ts-ignore Microsoft/TypeScript#21262 complains about a require of a JSON file
const product = require('../product.json'); const product = require('../product.json');
const rpmDependencies = require('../resources/linux/rpm/dependencies'); // @ts-ignore Microsoft/TypeScript#21262 complains about a require of a JSON file
const rpmDependencies = require('../resources/linux/rpm/dependencies.json');
const linuxPackageRevision = Math.floor(new Date().getTime() / 1000); const linuxPackageRevision = Math.floor(new Date().getTime() / 1000);
@@ -111,8 +114,7 @@ function buildDebPackage(arch) {
return shell.task([ return shell.task([
'chmod 755 ' + product.applicationName + '-' + debArch + '/DEBIAN/postinst ' + product.applicationName + '-' + debArch + '/DEBIAN/prerm ' + product.applicationName + '-' + debArch + '/DEBIAN/postrm', 'chmod 755 ' + product.applicationName + '-' + debArch + '/DEBIAN/postinst ' + product.applicationName + '-' + debArch + '/DEBIAN/prerm ' + product.applicationName + '-' + debArch + '/DEBIAN/postrm',
'mkdir -p deb', 'mkdir -p deb',
'fakeroot dpkg-deb -b ' + product.applicationName + '-' + debArch + ' deb', 'fakeroot dpkg-deb -b ' + product.applicationName + '-' + debArch + ' deb'
'dpkg-scanpackages deb /dev/null > Packages'
], { cwd: '.build/linux/deb/' + debArch }); ], { cwd: '.build/linux/deb/' + debArch });
} }
@@ -220,10 +222,10 @@ function prepareSnapPackage(arch) {
function buildSnapPackage(arch) { function buildSnapPackage(arch) {
const snapBuildPath = getSnapBuildPath(arch); const snapBuildPath = getSnapBuildPath(arch);
const snapFilename = `${product.applicationName}-${packageJson.version}-${linuxPackageRevision}-${arch}.snap`;
return shell.task([ return shell.task([
`chmod +x ${snapBuildPath}/electron-launch`, `chmod +x ${snapBuildPath}/electron-launch`,
`cd ${snapBuildPath} && snapcraft snap` `cd ${snapBuildPath} && snapcraft snap --output ../${snapFilename}`
]); ]);
} }

View File

@@ -11,8 +11,11 @@ const assert = require('assert');
const cp = require('child_process'); const cp = require('child_process');
const _7z = require('7zip')['7z']; const _7z = require('7zip')['7z'];
const util = require('./lib/util'); const util = require('./lib/util');
// @ts-ignore Microsoft/TypeScript#21262 complains about a require of a JSON file
const pkg = require('../package.json'); const pkg = require('../package.json');
// @ts-ignore Microsoft/TypeScript#21262 complains about a require of a JSON file
const product = require('../product.json'); const product = require('../product.json');
const vfs = require('vinyl-fs');
const repoPath = path.dirname(__dirname); const repoPath = path.dirname(__dirname);
// {{SQL CARBON EDIT}} // {{SQL CARBON EDIT}}
@@ -91,3 +94,13 @@ gulp.task('vscode-win32-ia32-archive', ['clean-vscode-win32-ia32-archive'], arch
gulp.task('clean-vscode-win32-x64-archive', util.rimraf(zipDir('x64'))); gulp.task('clean-vscode-win32-x64-archive', util.rimraf(zipDir('x64')));
gulp.task('vscode-win32-x64-archive', ['clean-vscode-win32-x64-archive'], archiveWin32Setup('x64')); gulp.task('vscode-win32-x64-archive', ['clean-vscode-win32-x64-archive'], archiveWin32Setup('x64'));
function copyInnoUpdater(arch) {
return () => {
return gulp.src('build/win32/{inno_updater.exe,vcruntime140.dll}', { base: 'build/win32' })
.pipe(vfs.dest(path.join(buildPath(arch), 'tools')));
};
}
gulp.task('vscode-win32-ia32-copy-inno-updater', copyInnoUpdater('ia32'));
gulp.task('vscode-win32-x64-copy-inno-updater', copyInnoUpdater('x64'));

118
build/lib/asar.js Normal file
View File

@@ -0,0 +1,118 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
var path = require("path");
var es = require("event-stream");
var pickle = require("chromium-pickle-js");
var Filesystem = require("asar/lib/filesystem");
var VinylFile = require("vinyl");
var minimatch = require("minimatch");
function createAsar(folderPath, unpackGlobs, destFilename) {
var shouldUnpackFile = function (file) {
for (var i = 0; i < unpackGlobs.length; i++) {
if (minimatch(file.relative, unpackGlobs[i])) {
return true;
}
}
return false;
};
var filesystem = new Filesystem(folderPath);
var out = [];
// Keep track of pending inserts
var pendingInserts = 0;
var onFileInserted = function () { pendingInserts--; };
// Do not insert twice the same directory
var seenDir = {};
var insertDirectoryRecursive = function (dir) {
if (seenDir[dir]) {
return;
}
var lastSlash = dir.lastIndexOf('/');
if (lastSlash === -1) {
lastSlash = dir.lastIndexOf('\\');
}
if (lastSlash !== -1) {
insertDirectoryRecursive(dir.substring(0, lastSlash));
}
seenDir[dir] = true;
filesystem.insertDirectory(dir);
};
var insertDirectoryForFile = function (file) {
var lastSlash = file.lastIndexOf('/');
if (lastSlash === -1) {
lastSlash = file.lastIndexOf('\\');
}
if (lastSlash !== -1) {
insertDirectoryRecursive(file.substring(0, lastSlash));
}
};
var insertFile = function (relativePath, stat, shouldUnpack) {
insertDirectoryForFile(relativePath);
pendingInserts++;
filesystem.insertFile(relativePath, shouldUnpack, { stat: stat }, {}, onFileInserted);
};
return es.through(function (file) {
if (file.stat.isDirectory()) {
return;
}
if (!file.stat.isFile()) {
throw new Error("unknown item in stream!");
}
var shouldUnpack = shouldUnpackFile(file);
insertFile(file.relative, { size: file.contents.length, mode: file.stat.mode }, shouldUnpack);
if (shouldUnpack) {
// The file goes outside of xx.asar, in a folder xx.asar.unpacked
var relative = path.relative(folderPath, file.path);
this.queue(new VinylFile({
cwd: folderPath,
base: folderPath,
path: path.join(destFilename + '.unpacked', relative),
stat: file.stat,
contents: file.contents
}));
}
else {
// The file goes inside of xx.asar
out.push(file.contents);
}
}, function () {
var _this = this;
var finish = function () {
{
var headerPickle = pickle.createEmpty();
headerPickle.writeString(JSON.stringify(filesystem.header));
var headerBuf = headerPickle.toBuffer();
var sizePickle = pickle.createEmpty();
sizePickle.writeUInt32(headerBuf.length);
var sizeBuf = sizePickle.toBuffer();
out.unshift(headerBuf);
out.unshift(sizeBuf);
}
var contents = Buffer.concat(out);
out.length = 0;
_this.queue(new VinylFile({
cwd: folderPath,
base: folderPath,
path: destFilename,
contents: contents
}));
_this.queue(null);
};
// Call finish() only when all file inserts have finished...
if (pendingInserts === 0) {
finish();
}
else {
onFileInserted = function () {
pendingInserts--;
if (pendingInserts === 0) {
finish();
}
};
}
});
}
exports.createAsar = createAsar;

131
build/lib/asar.ts Normal file
View File

@@ -0,0 +1,131 @@
/*---------------------------------------------------------------------------------------------
* 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 path from 'path';
import * as es from 'event-stream';
import * as pickle from 'chromium-pickle-js';
import * as Filesystem from 'asar/lib/filesystem';
import * as VinylFile from 'vinyl';
import * as minimatch from 'minimatch';
export function createAsar(folderPath: string, unpackGlobs: string[], destFilename: string): NodeJS.ReadWriteStream {
const shouldUnpackFile = (file: VinylFile): boolean => {
for (let i = 0; i < unpackGlobs.length; i++) {
if (minimatch(file.relative, unpackGlobs[i])) {
return true;
}
}
return false;
};
const filesystem = new Filesystem(folderPath);
const out: Buffer[] = [];
// Keep track of pending inserts
let pendingInserts = 0;
let onFileInserted = () => { pendingInserts--; };
// Do not insert twice the same directory
const seenDir: { [key: string]: boolean; } = {};
const insertDirectoryRecursive = (dir: string) => {
if (seenDir[dir]) {
return;
}
let lastSlash = dir.lastIndexOf('/');
if (lastSlash === -1) {
lastSlash = dir.lastIndexOf('\\');
}
if (lastSlash !== -1) {
insertDirectoryRecursive(dir.substring(0, lastSlash));
}
seenDir[dir] = true;
filesystem.insertDirectory(dir);
};
const insertDirectoryForFile = (file: string) => {
let lastSlash = file.lastIndexOf('/');
if (lastSlash === -1) {
lastSlash = file.lastIndexOf('\\');
}
if (lastSlash !== -1) {
insertDirectoryRecursive(file.substring(0, lastSlash));
}
};
const insertFile = (relativePath: string, stat: { size: number; mode: number; }, shouldUnpack: boolean) => {
insertDirectoryForFile(relativePath);
pendingInserts++;
filesystem.insertFile(relativePath, shouldUnpack, { stat: stat }, {}, onFileInserted);
};
return es.through(function (file) {
if (file.stat.isDirectory()) {
return;
}
if (!file.stat.isFile()) {
throw new Error(`unknown item in stream!`);
}
const shouldUnpack = shouldUnpackFile(file);
insertFile(file.relative, { size: file.contents.length, mode: file.stat.mode }, shouldUnpack);
if (shouldUnpack) {
// The file goes outside of xx.asar, in a folder xx.asar.unpacked
const relative = path.relative(folderPath, file.path);
this.queue(new VinylFile({
cwd: folderPath,
base: folderPath,
path: path.join(destFilename + '.unpacked', relative),
stat: file.stat,
contents: file.contents
}));
} else {
// The file goes inside of xx.asar
out.push(file.contents);
}
}, function () {
let finish = () => {
{
const headerPickle = pickle.createEmpty();
headerPickle.writeString(JSON.stringify(filesystem.header));
const headerBuf = headerPickle.toBuffer();
const sizePickle = pickle.createEmpty();
sizePickle.writeUInt32(headerBuf.length);
const sizeBuf = sizePickle.toBuffer();
out.unshift(headerBuf);
out.unshift(sizeBuf);
}
const contents = Buffer.concat(out);
out.length = 0;
this.queue(new VinylFile({
cwd: folderPath,
base: folderPath,
path: destFilename,
contents: contents
}));
this.queue(null);
};
// Call finish() only when all file inserts have finished...
if (pendingInserts === 0) {
finish();
} else {
onFileInserted = () => {
pendingInserts--;
if (pendingInserts === 0) {
finish();
}
};
}
});
}

View File

@@ -0,0 +1,122 @@
/*---------------------------------------------------------------------------------------------
* 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');
const os = require('os');
const mkdirp = require('mkdirp');
const rimraf = require('rimraf');
const es = require('event-stream');
const rename = require('gulp-rename');
const vfs = require('vinyl-fs');
const ext = require('./extensions');
const util = require('gulp-util');
const root = path.dirname(path.dirname(__dirname));
// @ts-ignore Microsoft/TypeScript#21262 complains about a require of a JSON file
const builtInExtensions = require('../builtInExtensions.json');
const controlFilePath = path.join(os.homedir(), '.vscode-oss-dev', 'extensions', 'control.json');
function getExtensionPath(extension) {
return path.join(root, '.build', 'builtInExtensions', extension.name);
}
function isUpToDate(extension) {
const packagePath = path.join(getExtensionPath(extension), 'package.json');
if (!fs.existsSync(packagePath)) {
return false;
}
const packageContents = fs.readFileSync(packagePath, { encoding: 'utf8' });
try {
const diskVersion = JSON.parse(packageContents).version;
return (diskVersion === extension.version);
} catch (err) {
return false;
}
}
function syncMarketplaceExtension(extension) {
if (isUpToDate(extension)) {
util.log(util.colors.blue('[marketplace]'), `${extension.name}@${extension.version}`, util.colors.green('✔︎'));
return es.readArray([]);
}
rimraf.sync(getExtensionPath(extension));
return ext.fromMarketplace(extension.name, extension.version)
.pipe(rename(p => p.dirname = `${extension.name}/${p.dirname}`))
.pipe(vfs.dest('.build/builtInExtensions'))
.on('end', () => util.log(util.colors.blue('[marketplace]'), extension.name, util.colors.green('✔︎')));
}
function syncExtension(extension, controlState) {
switch (controlState) {
case 'disabled':
util.log(util.colors.blue('[disabled]'), util.colors.gray(extension.name));
return es.readArray([]);
case 'marketplace':
return syncMarketplaceExtension(extension);
default:
if (!fs.existsSync(controlState)) {
util.log(util.colors.red(`Error: Built-in extension '${extension.name}' is configured to run from '${controlState}' but that path does not exist.`));
return es.readArray([]);
} else if (!fs.existsSync(path.join(controlState, 'package.json'))) {
util.log(util.colors.red(`Error: Built-in extension '${extension.name}' is configured to run from '${controlState}' but there is no 'package.json' file in that directory.`));
return es.readArray([]);
}
util.log(util.colors.blue('[local]'), `${extension.name}: ${util.colors.cyan(controlState)}`, util.colors.green('✔︎'));
return es.readArray([]);
}
}
function readControlFile() {
try {
return JSON.parse(fs.readFileSync(controlFilePath, 'utf8'));
} catch (err) {
return {};
}
}
function writeControlFile(control) {
mkdirp.sync(path.dirname(controlFilePath));
fs.writeFileSync(controlFilePath, JSON.stringify(control, null, 2));
}
function main() {
util.log('Syncronizing built-in extensions...');
util.log(`You can manage built-in extensions with the ${util.colors.cyan('--builtin')} flag`);
const control = readControlFile();
const streams = [];
for (const extension of builtInExtensions) {
let controlState = control[extension.name] || 'marketplace';
control[extension.name] = controlState;
streams.push(syncExtension(extension, controlState));
}
writeControlFile(control);
es.merge(streams)
.on('error', err => {
console.error(err);
process.exit(1);
})
.on('end', () => {
process.exit(0);
});
}
main();

View File

@@ -217,6 +217,7 @@ function removeDuplicateTSBoilerplate(destFiles) {
{ start: /^var __metadata/, end: /^};$/ }, { start: /^var __metadata/, end: /^};$/ },
{ start: /^var __param/, end: /^};$/ }, { start: /^var __param/, end: /^};$/ },
{ start: /^var __awaiter/, end: /^};$/ }, { start: /^var __awaiter/, end: /^};$/ },
{ start: /^var __generator/, end: /^};$/ },
]; ];
destFiles.forEach(function (destFile) { destFiles.forEach(function (destFile) {
var SEEN_BOILERPLATE = []; var SEEN_BOILERPLATE = [];

View File

@@ -44,11 +44,11 @@ interface ILoaderPluginReqFunc {
export interface IEntryPoint { export interface IEntryPoint {
name: string; name: string;
include: string[]; include?: string[];
exclude: string[]; exclude?: string[];
prepend: string[]; prepend: string[];
append: string[]; append?: string[];
dest: string; dest?: string;
} }
interface IEntryPointMap { interface IEntryPointMap {
@@ -339,6 +339,7 @@ function removeDuplicateTSBoilerplate(destFiles: IConcatFile[]): IConcatFile[] {
{ start: /^var __metadata/, end: /^};$/ }, { start: /^var __metadata/, end: /^};$/ },
{ start: /^var __param/, end: /^};$/ }, { start: /^var __param/, end: /^};$/ },
{ start: /^var __awaiter/, end: /^};$/ }, { start: /^var __awaiter/, end: /^};$/ },
{ start: /^var __generator/, end: /^};$/ },
]; ];
destFiles.forEach((destFile) => { destFiles.forEach((destFile) => {

View File

@@ -22,6 +22,9 @@ var rootDir = path.join(__dirname, '../../src');
var options = require('../../src/tsconfig.json').compilerOptions; var options = require('../../src/tsconfig.json').compilerOptions;
options.verbose = false; options.verbose = false;
options.sourceMap = true; options.sourceMap = true;
if (process.env['VSCODE_NO_SOURCEMAP']) {
options.sourceMap = false;
}
options.rootDir = rootDir; options.rootDir = rootDir;
options.sourceRoot = util.toFileUri(rootDir); options.sourceRoot = util.toFileUri(rootDir);
function createCompile(build, emitError) { function createCompile(build, emitError) {
@@ -58,9 +61,13 @@ function compileTask(out, build) {
return function () { return function () {
var compile = createCompile(build, true); var compile = createCompile(build, true);
var src = es.merge(gulp.src('src/**', { base: 'src' }), gulp.src('node_modules/typescript/lib/lib.d.ts')); var src = es.merge(gulp.src('src/**', { base: 'src' }), gulp.src('node_modules/typescript/lib/lib.d.ts'));
// Do not write .d.ts files to disk, as they are not needed there.
var dtsFilter = util.filter(function (data) { return !/\.d\.ts$/.test(data.path); });
return src return src
.pipe(compile()) .pipe(compile())
.pipe(dtsFilter)
.pipe(gulp.dest(out)) .pipe(gulp.dest(out))
.pipe(dtsFilter.restore)
.pipe(monacodtsTask(out, false)); .pipe(monacodtsTask(out, false));
}; };
} }
@@ -70,54 +77,19 @@ function watchTask(out, build) {
var compile = createCompile(build); var compile = createCompile(build);
var src = es.merge(gulp.src('src/**', { base: 'src' }), gulp.src('node_modules/typescript/lib/lib.d.ts')); var src = es.merge(gulp.src('src/**', { base: 'src' }), gulp.src('node_modules/typescript/lib/lib.d.ts'));
var watchSrc = watch('src/**', { base: 'src' }); var watchSrc = watch('src/**', { base: 'src' });
// Do not write .d.ts files to disk, as they are not needed there.
var dtsFilter = util.filter(function (data) { return !/\.d\.ts$/.test(data.path); });
return watchSrc return watchSrc
.pipe(util.incremental(compile, src, true)) .pipe(util.incremental(compile, src, true))
.pipe(dtsFilter)
.pipe(gulp.dest(out)) .pipe(gulp.dest(out))
.pipe(dtsFilter.restore)
.pipe(monacodtsTask(out, true)); .pipe(monacodtsTask(out, true));
}; };
} }
exports.watchTask = watchTask; exports.watchTask = watchTask;
function reloadTypeScriptNodeModule() {
var util = require('gulp-util');
function log(message) {
var rest = [];
for (var _i = 1; _i < arguments.length; _i++) {
rest[_i - 1] = arguments[_i];
}
util.log.apply(util, [util.colors.cyan('[memory watch dog]'), message].concat(rest));
}
function heapUsed() {
return (process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2) + ' MB';
}
return es.through(function (data) {
this.emit('data', data);
}, function () {
log('memory usage after compilation finished: ' + heapUsed());
// It appears we are running into some variant of
// https://bugs.chromium.org/p/v8/issues/detail?id=2073
//
// Even though all references are dropped, some
// optimized methods in the TS compiler end up holding references
// to the entire TypeScript language host (>600MB)
//
// The idea is to force v8 to drop references to these
// optimized methods, by "reloading" the typescript node module
log('Reloading typescript node module...');
var resolvedName = require.resolve('typescript');
var originalModule = require.cache[resolvedName];
delete require.cache[resolvedName];
var newExports = require('typescript');
require.cache[resolvedName] = originalModule;
for (var prop in newExports) {
if (newExports.hasOwnProperty(prop)) {
originalModule.exports[prop] = newExports[prop];
}
}
log('typescript node module reloaded.');
this.emit('end');
});
}
function monacodtsTask(out, isWatch) { function monacodtsTask(out, isWatch) {
var basePath = path.resolve(process.cwd(), out);
var neededFiles = {}; var neededFiles = {};
monacodts.getFilesToWatch(out).forEach(function (filePath) { monacodts.getFilesToWatch(out).forEach(function (filePath) {
filePath = path.normalize(filePath); filePath = path.normalize(filePath);
@@ -160,7 +132,7 @@ function monacodtsTask(out, isWatch) {
})); }));
} }
resultStream = es.through(function (data) { resultStream = es.through(function (data) {
var filePath = path.normalize(data.path); var filePath = path.normalize(path.resolve(basePath, data.relative));
if (neededFiles[filePath]) { if (neededFiles[filePath]) {
setInputFile(filePath, data.contents.toString()); setInputFile(filePath, data.contents.toString());
} }

View File

@@ -25,6 +25,9 @@ const rootDir = path.join(__dirname, '../../src');
const options = require('../../src/tsconfig.json').compilerOptions; const options = require('../../src/tsconfig.json').compilerOptions;
options.verbose = false; options.verbose = false;
options.sourceMap = true; options.sourceMap = true;
if (process.env['VSCODE_NO_SOURCEMAP']) { // To be used by developers in a hurry
options.sourceMap = false;
}
options.rootDir = rootDir; options.rootDir = rootDir;
options.sourceRoot = util.toFileUri(rootDir); options.sourceRoot = util.toFileUri(rootDir);
@@ -49,7 +52,6 @@ function createCompile(build: boolean, emitError?: boolean): (token?: util.ICanc
.pipe(tsFilter) .pipe(tsFilter)
.pipe(util.loadSourcemaps()) .pipe(util.loadSourcemaps())
.pipe(ts(token)) .pipe(ts(token))
// .pipe(build ? reloadTypeScriptNodeModule() : es.through())
.pipe(noDeclarationsFilter) .pipe(noDeclarationsFilter)
.pipe(build ? nls() : es.through()) .pipe(build ? nls() : es.through())
.pipe(noDeclarationsFilter.restore) .pipe(noDeclarationsFilter.restore)
@@ -75,9 +77,14 @@ export function compileTask(out: string, build: boolean): () => NodeJS.ReadWrite
gulp.src('node_modules/typescript/lib/lib.d.ts'), gulp.src('node_modules/typescript/lib/lib.d.ts'),
); );
// Do not write .d.ts files to disk, as they are not needed there.
const dtsFilter = util.filter(data => !/\.d\.ts$/.test(data.path));
return src return src
.pipe(compile()) .pipe(compile())
.pipe(dtsFilter)
.pipe(gulp.dest(out)) .pipe(gulp.dest(out))
.pipe(dtsFilter.restore)
.pipe(monacodtsTask(out, false)); .pipe(monacodtsTask(out, false));
}; };
} }
@@ -93,62 +100,22 @@ export function watchTask(out: string, build: boolean): () => NodeJS.ReadWriteSt
); );
const watchSrc = watch('src/**', { base: 'src' }); const watchSrc = watch('src/**', { base: 'src' });
// Do not write .d.ts files to disk, as they are not needed there.
const dtsFilter = util.filter(data => !/\.d\.ts$/.test(data.path));
return watchSrc return watchSrc
.pipe(util.incremental(compile, src, true)) .pipe(util.incremental(compile, src, true))
.pipe(dtsFilter)
.pipe(gulp.dest(out)) .pipe(gulp.dest(out))
.pipe(dtsFilter.restore)
.pipe(monacodtsTask(out, true)); .pipe(monacodtsTask(out, true));
}; };
} }
function reloadTypeScriptNodeModule(): NodeJS.ReadWriteStream {
var util = require('gulp-util');
function log(message: any, ...rest: any[]): void {
util.log(util.colors.cyan('[memory watch dog]'), message, ...rest);
}
function heapUsed(): string {
return (process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2) + ' MB';
}
return es.through(function (data) {
this.emit('data', data);
}, function () {
log('memory usage after compilation finished: ' + heapUsed());
// It appears we are running into some variant of
// https://bugs.chromium.org/p/v8/issues/detail?id=2073
//
// Even though all references are dropped, some
// optimized methods in the TS compiler end up holding references
// to the entire TypeScript language host (>600MB)
//
// The idea is to force v8 to drop references to these
// optimized methods, by "reloading" the typescript node module
log('Reloading typescript node module...');
var resolvedName = require.resolve('typescript');
var originalModule = require.cache[resolvedName];
delete require.cache[resolvedName];
var newExports = require('typescript');
require.cache[resolvedName] = originalModule;
for (var prop in newExports) {
if (newExports.hasOwnProperty(prop)) {
originalModule.exports[prop] = newExports[prop];
}
}
log('typescript node module reloaded.');
this.emit('end');
});
}
function monacodtsTask(out: string, isWatch: boolean): NodeJS.ReadWriteStream { function monacodtsTask(out: string, isWatch: boolean): NodeJS.ReadWriteStream {
const basePath = path.resolve(process.cwd(), out);
const neededFiles: { [file: string]: boolean; } = {}; const neededFiles: { [file: string]: boolean; } = {};
monacodts.getFilesToWatch(out).forEach(function (filePath) { monacodts.getFilesToWatch(out).forEach(function (filePath) {
filePath = path.normalize(filePath); filePath = path.normalize(filePath);
@@ -196,7 +163,7 @@ function monacodtsTask(out: string, isWatch: boolean): NodeJS.ReadWriteStream {
} }
resultStream = es.through(function (data) { resultStream = es.through(function (data) {
const filePath = path.normalize(data.path); const filePath = path.normalize(path.resolve(basePath, data.relative));
if (neededFiles[filePath]) { if (neededFiles[filePath]) {
setInputFile(filePath, data.contents.toString()); setInputFile(filePath, data.contents.toString());
} }

File diff suppressed because it is too large Load Diff

View File

@@ -46,10 +46,6 @@
"name": "vs/workbench/parts/execution", "name": "vs/workbench/parts/execution",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{
"name": "vs/workbench/parts/explorers",
"project": "vscode-workbench"
},
{ {
"name": "vs/workbench/parts/extensions", "name": "vs/workbench/parts/extensions",
"project": "vscode-workbench" "project": "vscode-workbench"
@@ -71,7 +67,11 @@
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
"name": "vs/workbench/parts/nps", "name": "vs/workbench/parts/localizations",
"project": "vscode-workbench"
},
{
"name": "vs/workbench/parts/logs",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{ {
@@ -138,6 +138,10 @@
"name": "vs/workbench/parts/welcome", "name": "vs/workbench/parts/welcome",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{
"name": "vs/workbench/services/actions",
"project": "vscode-workbench"
},
{ {
"name": "vs/workbench/services/configuration", "name": "vs/workbench/services/configuration",
"project": "vscode-workbench" "project": "vscode-workbench"
@@ -146,6 +150,10 @@
"name": "vs/workbench/services/crashReporter", "name": "vs/workbench/services/crashReporter",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{
"name": "vs/workbench/services/dialogs",
"project": "vscode-workbench"
},
{ {
"name": "vs/workbench/services/editor", "name": "vs/workbench/services/editor",
"project": "vscode-workbench" "project": "vscode-workbench"
@@ -154,6 +162,10 @@
"name": "vs/workbench/services/extensions", "name": "vs/workbench/services/extensions",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{
"name": "vs/workbench/services/jsonschemas",
"project": "vscode-workbench"
},
{ {
"name": "vs/workbench/services/files", "name": "vs/workbench/services/files",
"project": "vscode-workbench" "project": "vscode-workbench"
@@ -162,10 +174,6 @@
"name": "vs/workbench/services/keybinding", "name": "vs/workbench/services/keybinding",
"project": "vscode-workbench" "project": "vscode-workbench"
}, },
{
"name": "vs/workbench/services/message",
"project": "vscode-workbench"
},
{ {
"name": "vs/workbench/services/mode", "name": "vs/workbench/services/mode",
"project": "vscode-workbench" "project": "vscode-workbench"
@@ -193,10 +201,6 @@
{ {
"name": "vs/workbench/services/decorations", "name": "vs/workbench/services/decorations",
"project": "vscode-workbench" "project": "vscode-workbench"
},
{
"name": "setup_messages",
"project": "vscode-workbench"
} }
] ]
} }

File diff suppressed because it is too large Load Diff

View File

@@ -79,7 +79,7 @@ function isImportNode(node) {
function fileFrom(file, contents, path) { function fileFrom(file, contents, path) {
if (path === void 0) { path = file.path; } if (path === void 0) { path = file.path; }
return new File({ return new File({
contents: new Buffer(contents), contents: Buffer.from(contents),
base: file.base, base: file.base,
cwd: file.cwd, cwd: file.cwd,
path: path path: path

View File

@@ -131,7 +131,7 @@ module nls {
export function fileFrom(file: File, contents: string, path: string = file.path) { export function fileFrom(file: File, contents: string, path: string = file.path) {
return new File({ return new File({
contents: new Buffer(contents), contents: Buffer.from(contents),
base: file.base, base: file.base,
cwd: file.cwd, cwd: file.cwd,
path: path path: path

View File

@@ -59,7 +59,7 @@ function loader(bundledFileHeader, bundleLoader) {
this.emit('data', new VinylFile({ this.emit('data', new VinylFile({
path: 'fake', path: 'fake',
base: '', base: '',
contents: new Buffer(bundledFileHeader) contents: Buffer.from(bundledFileHeader)
})); }));
this.emit('data', data); this.emit('data', data);
} }
@@ -98,7 +98,7 @@ function toConcatStream(bundledFileHeader, sources, dest) {
return new VinylFile({ return new VinylFile({
path: source.path ? root + '/' + source.path.replace(/\\/g, '/') : 'fake', path: source.path ? root + '/' + source.path.replace(/\\/g, '/') : 'fake',
base: base, base: base,
contents: new Buffer(source.contents) contents: Buffer.from(source.contents)
}); });
}); });
return es.readArray(treatedSources) return es.readArray(treatedSources)
@@ -141,7 +141,7 @@ function optimizeTask(opts) {
bundleInfoArray.push(new VinylFile({ bundleInfoArray.push(new VinylFile({
path: 'bundleInfo.json', path: 'bundleInfo.json',
base: '.', base: '.',
contents: new Buffer(JSON.stringify(result.bundleData, null, '\t')) contents: Buffer.from(JSON.stringify(result.bundleData, null, '\t'))
})); }));
} }
es.readArray(bundleInfoArray).pipe(bundleInfoStream); es.readArray(bundleInfoArray).pipe(bundleInfoStream);
@@ -174,7 +174,6 @@ function optimizeTask(opts) {
}; };
} }
exports.optimizeTask = optimizeTask; exports.optimizeTask = optimizeTask;
;
/** /**
* Wrap around uglify and allow the preserveComments function * Wrap around uglify and allow the preserveComments function
* to have a file "context" to include our copyright only once per file. * to have a file "context" to include our copyright only once per file.
@@ -237,4 +236,3 @@ function minifyTask(src, sourceMapBaseUrl) {
}; };
} }
exports.minifyTask = minifyTask; exports.minifyTask = minifyTask;
;

View File

@@ -31,7 +31,7 @@ function log(prefix: string, message: string): void {
} }
// {{SQL CARBON EDIT}} // {{SQL CARBON EDIT}}
export function loaderConfig(emptyPaths: string[]) { export function loaderConfig(emptyPaths?: string[]) {
const result = { const result = {
paths: { paths: {
'vs': 'out-build/vs', 'vs': 'out-build/vs',
@@ -73,7 +73,7 @@ function loader(bundledFileHeader: string, bundleLoader: boolean): NodeJS.ReadWr
this.emit('data', new VinylFile({ this.emit('data', new VinylFile({
path: 'fake', path: 'fake',
base: '', base: '',
contents: new Buffer(bundledFileHeader) contents: Buffer.from(bundledFileHeader)
})); }));
this.emit('data', data); this.emit('data', data);
} else { } else {
@@ -117,7 +117,7 @@ function toConcatStream(bundledFileHeader: string, sources: bundle.IFile[], dest
return new VinylFile({ return new VinylFile({
path: source.path ? root + '/' + source.path.replace(/\\/g, '/') : 'fake', path: source.path ? root + '/' + source.path.replace(/\\/g, '/') : 'fake',
base: base, base: base,
contents: new Buffer(source.contents) contents: Buffer.from(source.contents)
}); });
}); });
@@ -165,7 +165,7 @@ export interface IOptimizeTaskOpts {
/** /**
* (languages to process) * (languages to process)
*/ */
languages: string[]; languages: i18n.Language[];
} }
export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStream { export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStream {
const entryPoints = opts.entryPoints; const entryPoints = opts.entryPoints;
@@ -201,7 +201,7 @@ export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStr
bundleInfoArray.push(new VinylFile({ bundleInfoArray.push(new VinylFile({
path: 'bundleInfo.json', path: 'bundleInfo.json',
base: '.', base: '.',
contents: new Buffer(JSON.stringify(result.bundleData, null, '\t')) contents: Buffer.from(JSON.stringify(result.bundleData, null, '\t'))
})); }));
} }
es.readArray(bundleInfoArray).pipe(bundleInfoStream); es.readArray(bundleInfoArray).pipe(bundleInfoStream);
@@ -241,7 +241,7 @@ export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStr
})) }))
.pipe(gulp.dest(out)); .pipe(gulp.dest(out));
}; };
}; }
declare class FileWithCopyright extends VinylFile { declare class FileWithCopyright extends VinylFile {
public __hasOurCopyright: boolean; public __hasOurCopyright: boolean;
@@ -295,7 +295,7 @@ function uglifyWithCopyrights(): NodeJS.ReadWriteStream {
return es.duplex(input, output); return es.duplex(input, output);
} }
export function minifyTask(src: string, sourceMapBaseUrl: string): (cb: any) => void { export function minifyTask(src: string, sourceMapBaseUrl?: string): (cb: any) => void {
const sourceMappingURL = sourceMapBaseUrl && (f => `${sourceMapBaseUrl}/${f.relative}.map`); const sourceMappingURL = sourceMapBaseUrl && (f => `${sourceMapBaseUrl}/${f.relative}.map`);
return cb => { return cb => {
@@ -326,4 +326,4 @@ export function minifyTask(src: string, sourceMapBaseUrl: string): (cb: any) =>
cb(err); cb(err);
}); });
}; };
}; }

View File

@@ -1,7 +1,14 @@
declare module "event-stream" { declare module "event-stream" {
import { Stream } from 'stream'; import { Stream } from 'stream';
import { ThroughStream } from 'through'; import { ThroughStream as _ThroughStream} from 'through';
import { MapStream } from 'map-stream'; import { MapStream } from 'map-stream';
import * as File from 'vinyl';
export interface ThroughStream extends _ThroughStream {
queue(data: File | null);
push(data: File | null);
paused: boolean;
}
function merge(streams: Stream[]): ThroughStream; function merge(streams: Stream[]): ThroughStream;
function merge(...streams: Stream[]): ThroughStream; function merge(...streams: Stream[]): ThroughStream;

View File

@@ -143,7 +143,7 @@ function loadSourcemaps() {
cb(null, f); cb(null, f);
return; return;
} }
f.contents = new Buffer(contents.replace(/\/\/# sourceMappingURL=(.*)$/g, ''), 'utf8'); f.contents = Buffer.from(contents.replace(/\/\/# sourceMappingURL=(.*)$/g, ''), 'utf8');
fs.readFile(path.join(path.dirname(f.path), lastMatch[1]), 'utf8', function (err, contents) { fs.readFile(path.join(path.dirname(f.path), lastMatch[1]), 'utf8', function (err, contents) {
if (err) { if (err) {
return cb(err); return cb(err);
@@ -160,7 +160,7 @@ function stripSourceMappingURL() {
var output = input var output = input
.pipe(es.mapSync(function (f) { .pipe(es.mapSync(function (f) {
var contents = f.contents.toString('utf8'); var contents = f.contents.toString('utf8');
f.contents = new Buffer(contents.replace(/\n\/\/# sourceMappingURL=(.*)$/gm, ''), 'utf8'); f.contents = Buffer.from(contents.replace(/\n\/\/# sourceMappingURL=(.*)$/gm, ''), 'utf8');
return f; return f;
})); }));
return es.duplex(input, output); return es.duplex(input, output);
@@ -173,7 +173,6 @@ function rimraf(dir) {
if (!err) { if (!err) {
return cb(); return cb();
} }
;
if (err.code === 'ENOTEMPTY' && ++retries < 5) { if (err.code === 'ENOTEMPTY' && ++retries < 5) {
return setTimeout(function () { return retry(cb); }, 10); return setTimeout(function () { return retry(cb); }, 10);
} }

View File

@@ -28,7 +28,7 @@ export interface IStreamProvider {
(cancellationToken?: ICancellationToken): NodeJS.ReadWriteStream; (cancellationToken?: ICancellationToken): NodeJS.ReadWriteStream;
} }
export function incremental(streamProvider: IStreamProvider, initial: NodeJS.ReadWriteStream, supportsCancellation: boolean): NodeJS.ReadWriteStream { export function incremental(streamProvider: IStreamProvider, initial: NodeJS.ReadWriteStream, supportsCancellation?: boolean): NodeJS.ReadWriteStream {
const input = es.through(); const input = es.through();
const output = es.through(); const output = es.through();
let state = 'idle'; let state = 'idle';
@@ -129,7 +129,7 @@ export function skipDirectories(): NodeJS.ReadWriteStream {
}); });
} }
export function cleanNodeModule(name: string, excludes: string[], includes: string[]): NodeJS.ReadWriteStream { export function cleanNodeModule(name: string, excludes: string[], includes?: string[]): NodeJS.ReadWriteStream {
const toGlob = (path: string) => '**/node_modules/' + name + (path ? '/' + path : ''); const toGlob = (path: string) => '**/node_modules/' + name + (path ? '/' + path : '');
const negate = (str: string) => '!' + str; const negate = (str: string) => '!' + str;
@@ -190,7 +190,7 @@ export function loadSourcemaps(): NodeJS.ReadWriteStream {
return; return;
} }
f.contents = new Buffer(contents.replace(/\/\/# sourceMappingURL=(.*)$/g, ''), 'utf8'); f.contents = Buffer.from(contents.replace(/\/\/# sourceMappingURL=(.*)$/g, ''), 'utf8');
fs.readFile(path.join(path.dirname(f.path), lastMatch[1]), 'utf8', (err, contents) => { fs.readFile(path.join(path.dirname(f.path), lastMatch[1]), 'utf8', (err, contents) => {
if (err) { return cb(err); } if (err) { return cb(err); }
@@ -209,7 +209,7 @@ export function stripSourceMappingURL(): NodeJS.ReadWriteStream {
const output = input const output = input
.pipe(es.mapSync<VinylFile, VinylFile>(f => { .pipe(es.mapSync<VinylFile, VinylFile>(f => {
const contents = (<Buffer>f.contents).toString('utf8'); const contents = (<Buffer>f.contents).toString('utf8');
f.contents = new Buffer(contents.replace(/\n\/\/# sourceMappingURL=(.*)$/gm, ''), 'utf8'); f.contents = Buffer.from(contents.replace(/\n\/\/# sourceMappingURL=(.*)$/gm, ''), 'utf8');
return f; return f;
})); }));
@@ -223,7 +223,7 @@ export function rimraf(dir: string): (cb: any) => void {
_rimraf(dir, { maxBusyTries: 1 }, (err: any) => { _rimraf(dir, { maxBusyTries: 1 }, (err: any) => {
if (!err) { if (!err) {
return cb(); return cb();
}; }
if (err.code === 'ENOTEMPTY' && ++retries < 5) { if (err.code === 'ENOTEMPTY' && ++retries < 5) {
return setTimeout(() => retry(cb), 10); return setTimeout(() => retry(cb), 10);

View File

@@ -9,7 +9,7 @@ const es = require('event-stream');
function handleDeletions() { function handleDeletions() {
return es.mapSync(f => { return es.mapSync(f => {
if (/\.ts$/.test(f.relative) && !f.contents) { if (/\.ts$/.test(f.relative) && !f.contents) {
f.contents = new Buffer(''); f.contents = Buffer.from('');
f.stat = { mtime: new Date() }; f.stat = { mtime: new Date() };
} }

View File

@@ -30,12 +30,12 @@ function watch(root) {
path: path, path: path,
base: root base: root
}); });
//@ts-ignore
file.event = type; file.event = type;
result.emit('data', file); result.emit('data', file);
} }
nsfw(root, function(events) { nsfw(root, function (events) {
for (var i = 0; i < events.length; i++) { for (var i = 0; i < events.length; i++) {
var e = events[i]; var e = events[i];
var changeType = e.action; var changeType = e.action;
@@ -47,16 +47,16 @@ function watch(root) {
handleEvent(path.join(e.directory, e.file), toChangeType(changeType)); handleEvent(path.join(e.directory, e.file), toChangeType(changeType));
} }
} }
}).then(function(watcher) { }).then(function (watcher) {
watcher.start(); watcher.start();
}); });
return result; return result;
} }
var cache = Object.create(null); var cache = Object.create(null);
module.exports = function(pattern, options) { module.exports = function (pattern, options) {
options = options || {}; options = options || {};
var cwd = path.normalize(options.cwd || process.cwd()); var cwd = path.normalize(options.cwd || process.cwd());
@@ -66,7 +66,7 @@ module.exports = function(pattern, options) {
watcher = cache[cwd] = watch(cwd); watcher = cache[cwd] = watch(cwd);
} }
var rebase = !options.base ? es.through() : es.mapSync(function(f) { var rebase = !options.base ? es.through() : es.mapSync(function (f) {
f.base = options.base; f.base = options.base;
return f; return f;
}); });
@@ -74,13 +74,13 @@ module.exports = function(pattern, options) {
return watcher return watcher
.pipe(filter(['**', '!.git{,/**}'])) // ignore all things git .pipe(filter(['**', '!.git{,/**}'])) // ignore all things git
.pipe(filter(pattern)) .pipe(filter(pattern))
.pipe(es.map(function(file, cb) { .pipe(es.map(function (file, cb) {
fs.stat(file.path, function(err, stat) { fs.stat(file.path, function (err, stat) {
if (err && err.code === 'ENOENT') { return cb(null, file); } if (err && err.code === 'ENOENT') { return cb(null, file); }
if (err) { return cb(); } if (err) { return cb(); }
if (!stat.isFile()) { return cb(); } if (!stat.isFile()) { return cb(); }
fs.readFile(file.path, function(err, contents) { fs.readFile(file.path, function (err, contents) {
if (err && err.code === 'ENOENT') { return cb(null, file); } if (err && err.code === 'ENOENT') { return cb(null, file); }
if (err) { return cb(); } if (err) { return cb(); }

View File

@@ -24,7 +24,8 @@ function watch(root) {
var result = es.through(); var result = es.through();
var child = cp.spawn(watcherPath, [root]); var child = cp.spawn(watcherPath, [root]);
child.stdout.on('data', function(data) { child.stdout.on('data', function (data) {
// @ts-ignore
var lines = data.toString('utf8').split('\n'); var lines = data.toString('utf8').split('\n');
for (var i = 0; i < lines.length; i++) { for (var i = 0; i < lines.length; i++) {
var line = lines[i].trim(); var line = lines[i].trim();
@@ -46,17 +47,17 @@ function watch(root) {
path: changePathFull, path: changePathFull,
base: root base: root
}); });
//@ts-ignore
file.event = toChangeType(changeType); file.event = toChangeType(changeType);
result.emit('data', file); result.emit('data', file);
} }
}); });
child.stderr.on('data', function(data) { child.stderr.on('data', function (data) {
result.emit('error', data); result.emit('error', data);
}); });
child.on('exit', function(code) { child.on('exit', function (code) {
result.emit('error', 'Watcher died with code ' + code); result.emit('error', 'Watcher died with code ' + code);
child = null; child = null;
}); });
@@ -70,7 +71,7 @@ function watch(root) {
var cache = Object.create(null); var cache = Object.create(null);
module.exports = function(pattern, options) { module.exports = function (pattern, options) {
options = options || {}; options = options || {};
var cwd = path.normalize(options.cwd || process.cwd()); var cwd = path.normalize(options.cwd || process.cwd());

View File

@@ -1 +1,21 @@
See project root directory The Source EULA
Copyright (c) 2016 Microsoft Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -32,7 +32,7 @@ END OF winjs NOTICES AND INFORMATION
%% string_scorer version 0.1.20 (https://github.com/joshaven/string_score) %% string_scorer version 0.1.20 (https://github.com/joshaven/string_score)
========================================= =========================================
This software is released under the MIT license: This software is released under the Source EULA:
Copyright (c) Joshaven Potter Copyright (c) Joshaven Potter
@@ -60,7 +60,7 @@ END OF string_scorer NOTICES AND INFORMATION
%% chjj-marked NOTICES AND INFORMATION BEGIN HERE %% chjj-marked NOTICES AND INFORMATION BEGIN HERE
========================================= =========================================
The MIT License (MIT) The Source EULA
Copyright (c) 2011-2014, Christopher Jeffrey (https://github.com/chjj/) Copyright (c) 2011-2014, Christopher Jeffrey (https://github.com/chjj/)

View File

@@ -62,19 +62,24 @@ export interface ICommandHandler {
#include(vs/editor/standalone/browser/colorizer): IColorizerOptions, IColorizerElementOptions #include(vs/editor/standalone/browser/colorizer): IColorizerOptions, IColorizerElementOptions
#include(vs/base/common/scrollable): ScrollbarVisibility #include(vs/base/common/scrollable): ScrollbarVisibility
#include(vs/platform/theme/common/themeService): ThemeColor #include(vs/platform/theme/common/themeService): ThemeColor
#includeAll(vs/editor/common/editorCommon;IMode=>languages.IMode;LanguageIdentifier=>languages.LanguageIdentifier;editorOptions.=>): ISelection, IScrollEvent #includeAll(vs/editor/common/model;LanguageIdentifier=>languages.LanguageIdentifier): IScrollEvent
#includeAll(vs/editor/common/editorCommon;editorOptions.=>): IScrollEvent
#includeAll(vs/editor/common/model/textModelEvents): #includeAll(vs/editor/common/model/textModelEvents):
#includeAll(vs/editor/common/controller/cursorEvents): #includeAll(vs/editor/common/controller/cursorEvents):
#includeAll(vs/editor/common/config/editorOptions): #includeAll(vs/editor/common/config/editorOptions):
#includeAll(vs/editor/browser/editorBrowser;editorCommon.=>;editorOptions.=>): #includeAll(vs/editor/browser/editorBrowser;editorCommon.=>;editorOptions.=>):
#include(vs/editor/common/config/fontInfo): FontInfo, BareFontInfo #include(vs/editor/common/config/fontInfo): FontInfo, BareFontInfo
//compatibility:
export type IReadOnlyModel = ITextModel;
export type IModel = ITextModel;
} }
declare module monaco.languages { declare module monaco.languages {
#includeAll(vs/editor/standalone/browser/standaloneLanguages;modes.=>;editorCommon.=>editor.;IMarkerData=>editor.IMarkerData): #includeAll(vs/editor/standalone/browser/standaloneLanguages;modes.=>;editorCommon.=>editor.;model.=>editor.;IMarkerData=>editor.IMarkerData):
#includeAll(vs/editor/common/modes/languageConfiguration): #includeAll(vs/editor/common/modes/languageConfiguration):
#includeAll(vs/editor/common/modes;editorCommon.IRange=>IRange;editorCommon.IPosition=>IPosition;editorCommon.=>editor.;IMarkerData=>editor.IMarkerData): #includeAll(vs/editor/common/modes;editorCommon.IRange=>IRange;editorCommon.IPosition=>IPosition;editorCommon.=>editor.;IMarkerData=>editor.IMarkerData;model.=>editor.):
#include(vs/editor/common/services/modeService): ILanguageExtensionPoint #include(vs/editor/common/services/modeService): ILanguageExtensionPoint
#includeAll(vs/editor/standalone/common/monarch/monarchTypes): #includeAll(vs/editor/standalone/common/monarch/monarchTypes):

View File

@@ -26,10 +26,11 @@ yarnInstall('extensions'); // node modules shared by all extensions
const extensions = [ const extensions = [
'vscode-colorize-tests', 'vscode-colorize-tests',
'json', 'json',
'mssql', 'mssql',
'configuration-editing', 'configuration-editing',
'extension-editing', 'extension-editing',
'markdown', 'markdown',
'markdown-basics',
'git', 'git',
'merge-conflict', 'merge-conflict',
'insights-default', 'insights-default',
@@ -42,6 +43,7 @@ extensions.forEach(extension => yarnInstall(`extensions/${extension}`));
function yarnInstallBuildDependencies() { function yarnInstallBuildDependencies() {
// make sure we install the deps of build/lib/watch for the system installed // make sure we install the deps of build/lib/watch for the system installed
// node, since that is the driver of gulp // node, since that is the driver of gulp
//@ts-ignore
const env = Object.assign({}, process.env); const env = Object.assign({}, process.env);
const watchPath = path.join(path.dirname(__dirname), 'lib', 'watch'); const watchPath = path.join(path.dirname(__dirname), 'lib', 'watch');
const yarnrcPath = path.join(watchPath, '.yarnrc'); const yarnrcPath = path.join(watchPath, '.yarnrc');
@@ -59,4 +61,5 @@ runtime "${runtime}"`;
} }
yarnInstall(`build`); // node modules required for build yarnInstall(`build`); // node modules required for build
yarnInstall('test/smoke'); // node modules required for smoketest
yarnInstallBuildDependencies(); // node modules for watching, specific to host node version, not electron yarnInstallBuildDependencies(); // node modules for watching, specific to host node version, not electron

View File

@@ -4,9 +4,11 @@
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
const cp = require('child_process'); const cp = require('child_process');
const npm = process.platform === 'win32' ? 'npm.cmd' : 'npm'; const fs = require('fs');
const path = require('path');
function updateGrammar(location) { function updateGrammar(location) {
const npm = process.platform === 'win32' ? 'npm.cmd' : 'npm';
const result = cp.spawnSync(npm, ['run', 'update-grammar'], { const result = cp.spawnSync(npm, ['run', 'update-grammar'], {
cwd: location, cwd: location,
stdio: 'inherit' stdio: 'inherit'
@@ -17,50 +19,17 @@ function updateGrammar(location) {
} }
} }
const extensions = [ const allExtensionFolders = fs.readdirSync('extensions');
'bat', const extensions = allExtensionFolders.filter(e => {
'clojure', try {
'coffeescript', let packageJSON = JSON.parse(fs.readFileSync(path.join('extensions', e, 'package.json')).toString());
'cpp', return packageJSON && packageJSON.scripts && packageJSON.scripts['update-grammar'];
'csharp', } catch (e) {
'css', return false;
'diff', }
'docker', });
'fsharp',
'gitsyntax', console.log(`Updating ${extensions.length} grammars...`);
'go',
'groovy',
'handlebars',
'hlsl',
'html',
'ini',
'java',
// 'javascript', updated through JavaScript
'json',
'less',
'lua',
'make',
'markdown',
'objective-c',
'perl',
'php',
// 'powershell', grammar not ready yet, @daviwil will ping when ready
'pug',
'python',
'r',
'razor',
'ruby',
'rust',
'scss',
'shaderlab',
'shellscript',
'sql',
'swift',
'typescript',
'vb',
'xml',
'yaml'
];
extensions.forEach(extension => updateGrammar(`extensions/${extension}`)); extensions.forEach(extension => updateGrammar(`extensions/${extension}`));
@@ -71,3 +40,4 @@ if (process.platform === 'win32') {
} else { } else {
cp.spawn('/bin/bash', ['./scripts/test-integration.sh'], { env: process.env, stdio: 'inherit' }); cp.spawn('/bin/bash', ['./scripts/test-integration.sh'], { env: process.env, stdio: 'inherit' });
} }

View File

@@ -14,14 +14,19 @@ var url = require('url');
function getOptions(urlString) { function getOptions(urlString) {
var _url = url.parse(urlString); var _url = url.parse(urlString);
var headers = {
'User-Agent': 'VSCode'
};
var token = process.env['GITHUB_TOKEN'];
if (token) {
headers['Authorization'] = 'token ' + token
}
return { return {
protocol: _url.protocol, protocol: _url.protocol,
host: _url.host, host: _url.host,
port: _url.port, port: _url.port,
path: _url.path, path: _url.path,
headers: { headers: headers
'User-Agent': 'NodeJS'
}
}; };
} }
@@ -32,12 +37,16 @@ function download(url, redirectCount) {
response.on('data', function (data) { response.on('data', function (data) {
content += data.toString(); content += data.toString();
}).on('end', function () { }).on('end', function () {
if (response.statusCode === 403 && response.headers['x-ratelimit-remaining'] === '0') {
e('GitHub API rate exceeded. Set GITHUB_TOKEN environment variable to increase rate limit.');
return;
}
let count = redirectCount || 0; let count = redirectCount || 0;
if (count < 5 && response.statusCode >= 300 && response.statusCode <= 303 || response.statusCode === 307) { if (count < 5 && response.statusCode >= 300 && response.statusCode <= 303 || response.statusCode === 307) {
let location = response.headers['location']; let location = response.headers['location'];
if (location) { if (location) {
console.log("Redirected " + url + " to " + location); console.log("Redirected " + url + " to " + location);
download(location, count+1).then(c, e); download(location, count + 1).then(c, e);
return; return;
} }
} }
@@ -59,17 +68,13 @@ function getCommitSha(repoId, repoPath) {
commitDate: lastCommit.commit.author.date commitDate: lastCommit.commit.author.date
}); });
} catch (e) { } catch (e) {
console.error("Failed extracting the SHA: " + content); return Promise.reject(new Error("Failed extracting the SHA: " + content));
return Promise.resolve(null);
} }
}, function () {
console.error('Failed loading ' + commitInfo);
return Promise.resolve(null);
}); });
} }
exports.update = function (repoId, repoPath, dest, modifyGrammar) { exports.update = function (repoId, repoPath, dest, modifyGrammar, version = 'master') {
var contentPath = 'https://raw.githubusercontent.com/' + repoId + '/master/' + repoPath; var contentPath = 'https://raw.githubusercontent.com/' + repoId + `/${version}/` + repoPath;
console.log('Reading from ' + contentPath); console.log('Reading from ' + contentPath);
return download(contentPath).then(function (content) { return download(contentPath).then(function (content) {
var ext = path.extname(repoPath); var ext = path.extname(repoPath);
@@ -81,8 +86,7 @@ exports.update = function (repoId, repoPath, dest, modifyGrammar) {
} else if (ext === '.json') { } else if (ext === '.json') {
grammar = JSON.parse(content); grammar = JSON.parse(content);
} else { } else {
console.error('Unknown file extension: ' + ext); return Promise.reject(new Error('Unknown file extension: ' + ext));
return;
} }
if (modifyGrammar) { if (modifyGrammar) {
modifyGrammar(grammar); modifyGrammar(grammar);
@@ -99,8 +103,10 @@ exports.update = function (repoId, repoPath, dest, modifyGrammar) {
if (info) { if (info) {
result.version = 'https://github.com/' + repoId + '/commit/' + info.commitSha; result.version = 'https://github.com/' + repoId + '/commit/' + info.commitSha;
} }
for (let key in grammar) {
if (!result.hasOwnProperty(key)) { let keys = ['name', 'scopeName', 'comment', 'injections', 'patterns', 'repository'];
for (let key of keys) {
if (grammar.hasOwnProperty(key)) {
result[key] = grammar[key]; result[key] = grammar[key];
} }
} }
@@ -113,11 +119,14 @@ exports.update = function (repoId, repoPath, dest, modifyGrammar) {
console.log('Updated ' + path.basename(dest)); console.log('Updated ' + path.basename(dest));
} }
} catch (e) { } catch (e) {
console.error(e); return Promise.reject(e);
} }
}); });
}, console.error); }, console.error).catch(e => {
console.error(e);
process.exit(1);
});
}; };
if (path.basename(process.argv[1]) === 'update-grammar.js') { if (path.basename(process.argv[1]) === 'update-grammar.js') {

View File

@@ -0,0 +1,69 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
let i18n = require("../lib/i18n");
let fs = require("fs");
let path = require("path");
let vfs = require("vinyl-fs");
let rimraf = require('rimraf');
function update(idOrPath) {
if (!idOrPath) {
throw new Error('Argument must be the location of the localization extension.');
}
let locExtFolder = idOrPath;
if (/^\w{2}(-\w+)?$/.test(idOrPath)) {
locExtFolder = '../vscode-language-pack-' + idOrPath;
}
let locExtStat = fs.statSync(locExtFolder);
if (!locExtStat || !locExtStat.isDirectory) {
throw new Error('No directory found at ' + idOrPath);
}
let packageJSON = JSON.parse(fs.readFileSync(path.join(locExtFolder, 'package.json')).toString());
let contributes = packageJSON['contributes'];
if (!contributes) {
throw new Error('The extension must define a "localizations" contribution in the "package.json"');
}
let localizations = contributes['localizations'];
if (!localizations) {
throw new Error('The extension must define a "localizations" contribution of type array in the "package.json"');
}
localizations.forEach(function (localization) {
if (!localization.languageId || !localization.languageName || !localization.localizedLanguageName) {
throw new Error('Each localization contribution must define "languageId", "languageName" and "localizedLanguageName" properties.');
}
let server = localization.server || 'www.transifex.com';
let userName = localization.userName || 'api';
let apiToken = process.env.TRANSIFEX_API_TOKEN;
let languageId = localization.transifexId || localization.languageId;
let translationDataFolder = path.join(locExtFolder, 'translations');
if (fs.existsSync(translationDataFolder) && fs.existsSync(path.join(translationDataFolder, 'main.i18n.json'))) {
console.log('Clearing \'' + translationDataFolder + '\'...');
rimraf.sync(translationDataFolder);
}
console.log('Downloading translations for \'' + languageId + '\' to \'' + translationDataFolder + '\'...');
const translationPaths = [];
i18n.pullI18nPackFiles(server, userName, apiToken, { id: languageId }, translationPaths)
.pipe(vfs.dest(translationDataFolder)).on('end', function () {
localization.translations = [];
for (let tp of translationPaths) {
localization.translations.push({ id: tp.id, path: `./translations/${tp.resourceName}`});
}
fs.writeFileSync(path.join(locExtFolder, 'package.json'), JSON.stringify(packageJSON, null, '\t'));
});
});
}
if (path.basename(process.argv[1]) === 'update-localization-extension.js') {
update(process.argv[2]);
}

View File

@@ -21,8 +21,9 @@
"xml2js": "^0.4.17" "xml2js": "^0.4.17"
}, },
"scripts": { "scripts": {
"compile": "tsc", "compile": "tsc -p tsconfig.build.json",
"watch": "tsc --watch", "watch": "tsc -p tsconfig.build.json --watch",
"postinstall": "npm run compile" "postinstall": "npm run compile",
"npmCheckJs": "tsc --noEmit"
} }
} }

View File

@@ -4,9 +4,9 @@ set -e
# setup nvm # setup nvm
if [[ "$OSTYPE" == "darwin"* ]]; then if [[ "$OSTYPE" == "darwin"* ]]; then
export NVM_DIR=~/.nvm export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh source $(brew --prefix nvm)/nvm.sh --no-use
else else
source $NVM_DIR/nvm.sh source $NVM_DIR/nvm.sh --no-use
fi fi
# install node # install node

View File

@@ -70,6 +70,7 @@ interface Asset {
hash: string; hash: string;
sha256hash: string; sha256hash: string;
size: number; size: number;
supportsFastUpdate?: boolean;
} }
function createOrUpdate(commit: string, quality: string, platform: string, type: string, release: NewDocument, asset: Asset, isUpdate: boolean): Promise<void> { function createOrUpdate(commit: string, quality: string, platform: string, type: string, release: NewDocument, asset: Asset, isUpdate: boolean): Promise<void> {
@@ -203,17 +204,30 @@ async function publish(commit: string, quality: string, platform: string, type:
// mooncake is fussy and far away, this is needed! // mooncake is fussy and far away, this is needed!
mooncakeBlobService.defaultClientRequestTimeoutInMs = 10 * 60 * 1000; mooncakeBlobService.defaultClientRequestTimeoutInMs = 10 * 60 * 1000;
await assertContainer(mooncakeBlobService, quality); await Promise.all([
assertContainer(blobService, quality),
assertContainer(mooncakeBlobService, quality)
]);
const mooncakeBlobExists = await doesAssetExist(mooncakeBlobService, quality, blobName); const [blobExists, moooncakeBlobExists] = await Promise.all([
doesAssetExist(blobService, quality, blobName),
doesAssetExist(mooncakeBlobService, quality, blobName)
]);
if (!mooncakeBlobExists) { const promises = [];
if (!blobExists) {
promises.push(uploadBlob(blobService, quality, blobName, file));
}
if (!moooncakeBlobExists) {
promises.push(uploadBlob(mooncakeBlobService, quality, blobName, file)); promises.push(uploadBlob(mooncakeBlobService, quality, blobName, file));
} }
} else { } else {
console.log('Skipping Mooncake publishing.'); console.log('Skipping Mooncake publishing.');
} }
if (promises.length === 0) { if (promises.length === 0) {
console.log(`Blob ${quality}, ${blobName} already exists, not publishing again.`); console.log(`Blob ${quality}, ${blobName} already exists, not publishing again.`);
return; return;
@@ -240,6 +254,13 @@ async function publish(commit: string, quality: string, platform: string, type:
size size
}; };
// Remove this if we ever need to rollback fast updates for windows
if (/win32/.test(platform)) {
asset.supportsFastUpdate = true;
}
console.log('Asset:', JSON.stringify(asset, null, ' '));
const release = { const release = {
id: commit, id: commit,
timestamp: (new Date()).getTime(), timestamp: (new Date()).getTime(),

View File

@@ -19,6 +19,9 @@ step "Install dependencies" \
step "Hygiene" \ step "Hygiene" \
npm run gulp -- hygiene npm run gulp -- hygiene
step "Monaco Editor Check" \
./node_modules/.bin/tsc -p ./src/tsconfig.monaco.json --noEmit
step "Mix in repository from vscode-distro" \ step "Mix in repository from vscode-distro" \
npm run gulp -- mixin npm run gulp -- mixin

View File

@@ -22,6 +22,9 @@ step "Install dependencies" \
step "Hygiene" \ step "Hygiene" \
npm run gulp -- hygiene npm run gulp -- hygiene
step "Monaco Editor Check" \
./node_modules/.bin/tsc -p ./src/tsconfig.monaco.json --noEmit
step "Mix in repository from vscode-distro" \ step "Mix in repository from vscode-distro" \
npm run gulp -- mixin npm run gulp -- mixin

View File

@@ -24,6 +24,10 @@ step "Hygiene" {
exec { & npm run gulp -- hygiene } exec { & npm run gulp -- hygiene }
} }
step "Monaco Editor Check" {
exec { & .\node_modules\.bin\tsc -p .\src\tsconfig.monaco.json --noEmit }
}
$env:VSCODE_MIXIN_PASSWORD = $mixinPassword $env:VSCODE_MIXIN_PASSWORD = $mixinPassword
step "Mix in repository from vscode-distro" { step "Mix in repository from vscode-distro" {
exec { & npm run gulp -- mixin } exec { & npm run gulp -- mixin }
@@ -41,6 +45,10 @@ step "Build minified" {
exec { & npm run gulp -- "vscode-win32-$global:arch-min" } exec { & npm run gulp -- "vscode-win32-$global:arch-min" }
} }
step "Copy Inno updater" {
exec { & npm run gulp -- "vscode-win32-$global:arch-copy-inno-updater" }
}
# step "Create loader snapshot" { # step "Create loader snapshot" {
# exec { & node build\lib\snapshotLoader.js --arch=$global:arch } # exec { & node build\lib\snapshotLoader.js --arch=$global:arch }
# } # }

View File

@@ -1,7 +1,7 @@
# install node # install node
$env:Path = $env:NVM_HOME + ";" + $env:NVM_SYMLINK + ";" + $env:Path $env:Path = $env:NVM_HOME + ";" + $env:NVM_SYMLINK + ";" + $env:Path
$NodeVersion = "8.9.1" $NodeVersion = "8.9.1"
nvm install $NodeVersion # nvm install $NodeVersion
nvm use $NodeVersion # nvm use $NodeVersion
npm install -g yarn # npm install -g yarn
$env:Path = $env:NVM_HOME + "\v" + $NodeVersion + ";" + $env:Path $env:Path = $env:NVM_HOME + "\v" + $NodeVersion + ";" + $env:Path

View File

@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"allowJs": false,
"checkJs": false
}
}

View File

@@ -7,7 +7,12 @@
"preserveConstEnums": true, "preserveConstEnums": true,
"sourceMap": false, "sourceMap": false,
"experimentalDecorators": true, "experimentalDecorators": true,
"newLine": "LF" "newLine": "LF",
// enable JavaScript type checking for the language service
// use the tsconfig.build.json for compiling wich disable JavaScript
// type checking so that JavaScript file are not transpiled
"allowJs": true,
"checkJs": true
}, },
"exclude": [ "exclude": [
"node_modules/**" "node_modules/**"

View File

@@ -9,5 +9,6 @@
"always" "always"
], ],
"triple-equals": true "triple-equals": true
} },
"defaultSeverity": "warning"
} }

1794
build/win32/OSSREADME.json Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -19,7 +19,7 @@ OutputDir={#OutputDir}
OutputBaseFilename=SqlOpsStudioSetup OutputBaseFilename=SqlOpsStudioSetup
Compression=lzma Compression=lzma
SolidCompression=yes SolidCompression=yes
AppMutex={#AppMutex} AppMutex={code:GetAppMutex}
SetupMutex={#AppMutex}setup SetupMutex={#AppMutex}setup
WizardImageFile={#RepoDir}\resources\win32\inno-big.bmp WizardImageFile={#RepoDir}\resources\win32\inno-big.bmp
WizardSmallImageFile={#RepoDir}\resources\win32\inno-small.bmp WizardSmallImageFile={#RepoDir}\resources\win32\inno-small.bmp
@@ -52,8 +52,13 @@ Type: filesandordirs; Name: "{app}\resources\app\out"; Check: IsNotUpdate
Type: filesandordirs; Name: "{app}\resources\app\plugins"; Check: IsNotUpdate Type: filesandordirs; Name: "{app}\resources\app\plugins"; Check: IsNotUpdate
Type: filesandordirs; Name: "{app}\resources\app\extensions"; Check: IsNotUpdate Type: filesandordirs; Name: "{app}\resources\app\extensions"; Check: IsNotUpdate
Type: filesandordirs; Name: "{app}\resources\app\node_modules"; Check: IsNotUpdate Type: filesandordirs; Name: "{app}\resources\app\node_modules"; Check: IsNotUpdate
Type: filesandordirs; Name: "{app}\resources\app\node_modules.asar.unpacked"; Check: IsNotUpdate
Type: files; Name: "{app}\resources\app\node_modules.asar"; Check: IsNotUpdate
Type: files; Name: "{app}\resources\app\Credits_45.0.2454.85.html"; Check: IsNotUpdate Type: files; Name: "{app}\resources\app\Credits_45.0.2454.85.html"; Check: IsNotUpdate
[UninstallDelete]
Type: filesandordirs; Name: "{app}\_"
[Tasks] [Tasks]
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1 Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1
Name: "addtopath"; Description: "{cm:AddToPath}"; GroupDescription: "{cm:Other}" Name: "addtopath"; Description: "{cm:AddToPath}"; GroupDescription: "{cm:Other}"
@@ -138,6 +143,48 @@ begin
Result := True; Result := True;
end; end;
function GetAppMutex(Value: string): string;
begin
if IsBackgroundUpdate() then
Result := ''
else
Result := '{#AppMutex}';
end;
function GetDestDir(Value: string): string;
begin
if IsBackgroundUpdate() then
Result := ExpandConstant('{app}\_')
else
Result := ExpandConstant('{app}');
end;
function BoolToStr(Value: Boolean): String;
begin
if Value then
Result := 'true'
else
Result := 'false';
end;
procedure CurStepChanged(CurStep: TSetupStep);
var
UpdateResultCode: Integer;
begin
if IsBackgroundUpdate() and (CurStep = ssPostInstall) then
begin
CreateMutex('{#AppMutex}-ready');
while (CheckForMutexes('{#AppMutex}')) do
begin
Log('Application is still running, waiting');
Sleep(1000);
end;
Exec(ExpandConstant('{app}\tools\inno_updater.exe'), ExpandConstant('"{app}\{#ExeBasename}.exe" ' + BoolToStr(LockFileExists())), '', SW_SHOW, ewWaitUntilTerminated, UpdateResultCode);
end;
end;
// http://stackoverflow.com/a/23838239/261019 // http://stackoverflow.com/a/23838239/261019
procedure Explode(var Dest: TArrayOfString; Text: String; Separator: String); procedure Explode(var Dest: TArrayOfString; Text: String; Separator: String);
var var

Binary file not shown.

Binary file not shown.

View File

@@ -27,8 +27,8 @@
resolved "https://registry.yarnpkg.com/@types/mime/-/mime-0.0.29.tgz#fbcfd330573b912ef59eeee14602bface630754b" resolved "https://registry.yarnpkg.com/@types/mime/-/mime-0.0.29.tgz#fbcfd330573b912ef59eeee14602bface630754b"
"@types/node@*": "@types/node@*":
version "9.6.0" version "8.0.51"
resolved "https://registry.yarnpkg.com/@types/node/-/node-9.6.0.tgz#d3480ee666df9784b1001a1872a2f6ccefb6c2d7" resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.51.tgz#b31d716fb8d58eeb95c068a039b9b6292817d5fb"
"@types/node@8.0.33": "@types/node@8.0.33":
version "8.0.33" version "8.0.33"
@@ -44,6 +44,13 @@ agent-base@4, agent-base@^4.1.0:
dependencies: dependencies:
es6-promisify "^5.0.0" es6-promisify "^5.0.0"
ajv@^4.9.1:
version "4.11.8"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-4.11.8.tgz#82ffb02b29e662ae53bdc20af15947706739c536"
dependencies:
co "^4.6.0"
json-stable-stringify "^1.0.1"
ajv@^5.1.0: ajv@^5.1.0:
version "5.5.2" version "5.5.2"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965" resolved "https://registry.yarnpkg.com/ajv/-/ajv-5.5.2.tgz#73b5eeca3fab653e3d3f9422b341ad42205dc965"
@@ -159,19 +166,19 @@ aws4@^1.2.1, aws4@^1.6.0:
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e" resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.6.0.tgz#83ef5ca860b2b32e4a0deedee8c771b9db57471e"
azure-storage@^2.1.0: azure-storage@^2.1.0:
version "2.8.1" version "2.6.0"
resolved "https://registry.yarnpkg.com/azure-storage/-/azure-storage-2.8.1.tgz#ecb9d050ef1395e79ffbb652c02fe643687bec63" resolved "https://registry.yarnpkg.com/azure-storage/-/azure-storage-2.6.0.tgz#84747ee54a4bd194bb960f89f3eff89d67acf1cf"
dependencies: dependencies:
browserify-mime "~1.2.9" browserify-mime "~1.2.9"
extend "~1.2.1" extend "~1.2.1"
json-edm-parser "0.1.2" json-edm-parser "0.1.2"
md5.js "1.3.4" md5.js "1.3.4"
readable-stream "~2.0.0" readable-stream "~2.0.0"
request "~2.83.0" request "~2.81.0"
underscore "~1.8.3" underscore "~1.8.3"
uuid "^3.0.0" uuid "^3.0.0"
validator "~9.4.1" validator "~3.35.0"
xml2js "0.2.8" xml2js "0.2.7"
xmlbuilder "0.4.3" xmlbuilder "0.4.3"
balanced-match@^1.0.0: balanced-match@^1.0.0:
@@ -324,12 +331,18 @@ color-support@^1.1.3:
version "1.1.3" version "1.1.3"
resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2" resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2"
combined-stream@1.0.6, combined-stream@^1.0.5, combined-stream@~1.0.5: combined-stream@1.0.6:
version "1.0.6" version "1.0.6"
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.6.tgz#723e7df6e801ac5613113a7e445a9b69cb632818"
dependencies: dependencies:
delayed-stream "~1.0.0" delayed-stream "~1.0.0"
combined-stream@^1.0.5, combined-stream@~1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009"
dependencies:
delayed-stream "~1.0.0"
commander@2.11.0: commander@2.11.0:
version "2.11.0" version "2.11.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563" resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563"
@@ -554,14 +567,10 @@ extglob@^0.3.1:
dependencies: dependencies:
is-extglob "^1.0.0" is-extglob "^1.0.0"
extsprintf@1.3.0: extsprintf@1.3.0, extsprintf@^1.2.0:
version "1.3.0" version "1.3.0"
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05"
extsprintf@^1.2.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f"
fancy-log@^1.1.0: fancy-log@^1.1.0:
version "1.3.2" version "1.3.2"
resolved "https://registry.yarnpkg.com/fancy-log/-/fancy-log-1.3.2.tgz#f41125e3d84f2e7d89a43d06d958c8f78be16be1" resolved "https://registry.yarnpkg.com/fancy-log/-/fancy-log-1.3.2.tgz#f41125e3d84f2e7d89a43d06d958c8f78be16be1"
@@ -873,6 +882,10 @@ gulplog@^1.0.0:
dependencies: dependencies:
glogg "^1.0.0" glogg "^1.0.0"
har-schema@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-1.0.5.tgz#d263135f43307c02c602afc8fe95970c0151369e"
har-schema@^2.0.0: har-schema@^2.0.0:
version "2.0.0" version "2.0.0"
resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92"
@@ -886,6 +899,13 @@ har-validator@~2.0.6:
is-my-json-valid "^2.12.4" is-my-json-valid "^2.12.4"
pinkie-promise "^2.0.0" pinkie-promise "^2.0.0"
har-validator@~4.2.1:
version "4.2.1"
resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-4.2.1.tgz#33481d0f1bbff600dd203d75812a6a5fba002e2a"
dependencies:
ajv "^4.9.1"
har-schema "^1.0.5"
har-validator@~5.0.3: har-validator@~5.0.3:
version "5.0.3" version "5.0.3"
resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.0.3.tgz#ba402c266194f15956ef15e0fcf242993f6a7dfd" resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.0.3.tgz#ba402c266194f15956ef15e0fcf242993f6a7dfd"
@@ -970,8 +990,8 @@ http-signature@~1.2.0:
sshpk "^1.7.0" sshpk "^1.7.0"
https-proxy-agent@^2.1.1: https-proxy-agent@^2.1.1:
version "2.2.0" version "2.2.1"
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.0.tgz#7fbba856be8cd677986f42ebd3664f6317257887" resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz#51552970fa04d723e04c56d04178c3f92592bbc0"
dependencies: dependencies:
agent-base "^4.1.0" agent-base "^4.1.0"
debug "^3.1.0" debug "^3.1.0"
@@ -1131,7 +1151,7 @@ json-schema@0.2.3:
version "0.2.3" version "0.2.3"
resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13"
json-stable-stringify@^1.0.0: json-stable-stringify@^1.0.0, json-stable-stringify@^1.0.1:
version "1.0.1" version "1.0.1"
resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af" resolved "https://registry.yarnpkg.com/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz#9a759d39c5f2ff503fd5300646ed445f88c4f9af"
dependencies: dependencies:
@@ -1318,19 +1338,29 @@ micromatch@^2.3.7:
parse-glob "^3.0.4" parse-glob "^3.0.4"
regex-cache "^0.4.2" regex-cache "^0.4.2"
mime-db@~1.30.0:
version "1.30.0"
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.30.0.tgz#74c643da2dd9d6a45399963465b26d5ca7d71f01"
mime-db@~1.33.0: mime-db@~1.33.0:
version "1.33.0" version "1.33.0"
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.33.0.tgz#a3492050a5cb9b63450541e39d9788d2272783db" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.33.0.tgz#a3492050a5cb9b63450541e39d9788d2272783db"
mime-types@^2.1.12, mime-types@~2.1.17, mime-types@~2.1.7: mime-types@^2.1.12, mime-types@~2.1.7:
version "2.1.17"
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.17.tgz#09d7a393f03e995a79f8af857b70a9e0ab16557a"
dependencies:
mime-db "~1.30.0"
mime-types@~2.1.17:
version "2.1.18" version "2.1.18"
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.18.tgz#6f323f60a83d11146f831ff11fd66e2fe5503bb8" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.18.tgz#6f323f60a83d11146f831ff11fd66e2fe5503bb8"
dependencies: dependencies:
mime-db "~1.33.0" mime-db "~1.33.0"
mime@^1.3.4: mime@^1.3.4:
version "1.6.0" version "1.4.1"
resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" resolved "https://registry.yarnpkg.com/mime/-/mime-1.4.1.tgz#121f9ebc49e3766f311a76e1fa1c8003c4b03aa6"
"minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.4: "minimatch@2 || 3", minimatch@^3.0.0, minimatch@^3.0.4:
version "3.0.4" version "3.0.4"
@@ -1461,6 +1491,10 @@ pend@~1.2.0:
version "1.2.0" version "1.2.0"
resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50"
performance-now@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5"
performance-now@^2.1.0: performance-now@^2.1.0:
version "2.1.0" version "2.1.0"
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
@@ -1517,6 +1551,10 @@ qs@~6.3.0:
version "6.3.2" version "6.3.2"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.2.tgz#e75bd5f6e268122a2a0e0bda630b2550c166502c" resolved "https://registry.yarnpkg.com/qs/-/qs-6.3.2.tgz#e75bd5f6e268122a2a0e0bda630b2550c166502c"
qs@~6.4.0:
version "6.4.0"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233"
qs@~6.5.1: qs@~6.5.1:
version "6.5.1" version "6.5.1"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8"
@@ -1663,32 +1701,32 @@ request@~2.79.0:
tunnel-agent "~0.4.1" tunnel-agent "~0.4.1"
uuid "^3.0.0" uuid "^3.0.0"
request@~2.83.0: request@~2.81.0:
version "2.83.0" version "2.81.0"
resolved "https://registry.yarnpkg.com/request/-/request-2.83.0.tgz#ca0b65da02ed62935887808e6f510381034e3356" resolved "https://registry.yarnpkg.com/request/-/request-2.81.0.tgz#c6928946a0e06c5f8d6f8a9333469ffda46298a0"
dependencies: dependencies:
aws-sign2 "~0.7.0" aws-sign2 "~0.6.0"
aws4 "^1.6.0" aws4 "^1.2.1"
caseless "~0.12.0" caseless "~0.12.0"
combined-stream "~1.0.5" combined-stream "~1.0.5"
extend "~3.0.1" extend "~3.0.0"
forever-agent "~0.6.1" forever-agent "~0.6.1"
form-data "~2.3.1" form-data "~2.1.1"
har-validator "~5.0.3" har-validator "~4.2.1"
hawk "~6.0.2" hawk "~3.1.3"
http-signature "~1.2.0" http-signature "~1.1.0"
is-typedarray "~1.0.0" is-typedarray "~1.0.0"
isstream "~0.1.2" isstream "~0.1.2"
json-stringify-safe "~5.0.1" json-stringify-safe "~5.0.1"
mime-types "~2.1.17" mime-types "~2.1.7"
oauth-sign "~0.8.2" oauth-sign "~0.8.1"
performance-now "^2.1.0" performance-now "^0.2.0"
qs "~6.5.1" qs "~6.4.0"
safe-buffer "^5.1.1" safe-buffer "^5.0.1"
stringstream "~0.0.5" stringstream "~0.0.4"
tough-cookie "~2.3.3" tough-cookie "~2.3.0"
tunnel-agent "^0.6.0" tunnel-agent "^0.6.0"
uuid "^3.1.0" uuid "^3.0.0"
requires-port@~1.0.0: requires-port@~1.0.0:
version "1.0.0" version "1.0.0"
@@ -1704,9 +1742,9 @@ safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
version "5.1.1" version "5.1.1"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853"
sax@0.5.x: sax@0.5.2:
version "0.5.8" version "0.5.2"
resolved "https://registry.yarnpkg.com/sax/-/sax-0.5.8.tgz#d472db228eb331c2506b0e8c15524adb939d12c1" resolved "https://registry.yarnpkg.com/sax/-/sax-0.5.2.tgz#735ffaa39a1cff8ffb9598f0223abdb03a9fb2ea"
sax@>=0.6.0: sax@>=0.6.0:
version "1.2.4" version "1.2.4"
@@ -1770,8 +1808,8 @@ split@0.3:
through "2" through "2"
sshpk@^1.7.0: sshpk@^1.7.0:
version "1.14.1" version "1.13.1"
resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.14.1.tgz#130f5975eddad963f1d56f92b9ac6c51fa9f83eb" resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.13.1.tgz#512df6da6287144316dc4c18fe1cf1d940739be3"
dependencies: dependencies:
asn1 "~0.2.3" asn1 "~0.2.3"
assert-plus "^1.0.0" assert-plus "^1.0.0"
@@ -1914,7 +1952,13 @@ to-absolute-glob@^0.1.1:
dependencies: dependencies:
extend-shallow "^2.0.1" extend-shallow "^2.0.1"
tough-cookie@~2.3.0, tough-cookie@~2.3.3: tough-cookie@~2.3.0:
version "2.3.3"
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.3.tgz#0b618a5565b6dea90bf3425d04d55edc475a7561"
dependencies:
punycode "^1.4.1"
tough-cookie@~2.3.3:
version "2.3.4" version "2.3.4"
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.4.tgz#ec60cee38ac675063ffc97a5c18970578ee83655" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.3.4.tgz#ec60cee38ac675063ffc97a5c18970578ee83655"
dependencies: dependencies:
@@ -1967,7 +2011,11 @@ util-deprecate@~1.0.1:
version "1.0.2" version "1.0.2"
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
uuid@^3.0.0, uuid@^3.1.0: uuid@^3.0.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.1.0.tgz#3dd3d3e790abc24d7b0d3a034ffababe28ebbc04"
uuid@^3.1.0:
version "3.2.1" version "3.2.1"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.2.1.tgz#12c528bb9d58d0b9265d9a2f6f0fe8be17ff1f14" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.2.1.tgz#12c528bb9d58d0b9265d9a2f6f0fe8be17ff1f14"
@@ -1975,9 +2023,9 @@ vali-date@^1.0.0:
version "1.0.0" version "1.0.0"
resolved "https://registry.yarnpkg.com/vali-date/-/vali-date-1.0.0.tgz#1b904a59609fb328ef078138420934f6b86709a6" resolved "https://registry.yarnpkg.com/vali-date/-/vali-date-1.0.0.tgz#1b904a59609fb328ef078138420934f6b86709a6"
validator@~9.4.1: validator@~3.35.0:
version "9.4.1" version "3.35.0"
resolved "https://registry.yarnpkg.com/validator/-/validator-9.4.1.tgz#abf466d398b561cd243050112c6ff1de6cc12663" resolved "https://registry.yarnpkg.com/validator/-/validator-3.35.0.tgz#3f07249402c1fc8fc093c32c6e43d72a79cca1dc"
verror@1.10.0: verror@1.10.0:
version "1.10.0" version "1.10.0"
@@ -2085,11 +2133,11 @@ wrappy@1:
version "1.0.2" version "1.0.2"
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
xml2js@0.2.8: xml2js@0.2.7:
version "0.2.8" version "0.2.7"
resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.2.8.tgz#9b81690931631ff09d1957549faf54f4f980b3c2" resolved "https://registry.yarnpkg.com/xml2js/-/xml2js-0.2.7.tgz#1838518bb01741cae0878bab4915e494c32306af"
dependencies: dependencies:
sax "0.5.x" sax "0.5.2"
xml2js@^0.4.17: xml2js@^0.4.17:
version "0.4.19" version "0.4.19"
@@ -2103,8 +2151,8 @@ xmlbuilder@0.4.3:
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-0.4.3.tgz#c4614ba74e0ad196e609c9272cd9e1ddb28a8a58" resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-0.4.3.tgz#c4614ba74e0ad196e609c9272cd9e1ddb28a8a58"
xmlbuilder@~9.0.1: xmlbuilder@~9.0.1:
version "9.0.7" version "9.0.4"
resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.7.tgz#132ee63d2ec5565c557e20f4c22df9aca686b10d" resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-9.0.4.tgz#519cb4ca686d005a8420d3496f3f0caeecca580f"
"xtend@>=4.0.0 <4.1.0-0", xtend@^4.0.0, xtend@~4.0.0, xtend@~4.0.1: "xtend@>=4.0.0 <4.1.0-0", xtend@^4.0.0, xtend@~4.0.0, xtend@~4.0.1:
version "4.0.1" version "4.0.1"

View File

@@ -1,6 +1,8 @@
{ {
"name": "bat", "name": "bat",
"version": "0.1.0", "displayName": "%displayName%",
"description": "%description%",
"version": "1.0.0",
"publisher": "vscode", "publisher": "vscode",
"engines": { "vscode": "*" }, "engines": { "vscode": "*" },
"scripts": { "scripts": {

View File

@@ -0,0 +1,4 @@
{
"displayName": "Windows Bat Language Basics",
"description": "Provides snippets, syntax highlighting, bracket matching and folding in Windows batch files."
}

View File

@@ -1,169 +0,0 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>uuid</key>
<string>E07EC438-7B75-4437-8AA1-DA94C1E6EACC</string>
<key>patterns</key>
<array>
<dict>
<key>name</key>
<string>keyword.command.dosbatch</string>
<key>match</key>
<string>\b(?i)(?:append|assoc|at|attrib|break|cacls|cd|chcp|chdir|chkdsk|chkntfs|cls|cmd|color|comp|compact|convert|copy|date|del|dir|diskcomp|diskcopy|doskey|echo|endlocal|erase|fc|find|findstr|format|ftype|graftabl|help|keyb|label|md|mkdir|mode|more|move|path|pause|popd|print|prompt|pushd|rd|recover|ren|rename|replace|restore|rmdir|set|setlocal|shift|sort|start|subst|time|title|tree|type|ver|verify|vol|xcopy)\b</string>
</dict>
<dict>
<key>name</key>
<string>keyword.control.statement.dosbatch</string>
<key>match</key>
<string>\b(?i)(?:goto|call|exit)\b</string>
</dict>
<dict>
<key>name</key>
<string>keyword.control.conditional.if.dosbatch</string>
<key>match</key>
<string>\b(?i)if\s+((not)\s+)(exist|defined|errorlevel|cmdextversion)\b</string>
</dict>
<dict>
<key>name</key>
<string>keyword.control.conditional.dosbatch</string>
<key>match</key>
<string>\b(?i)(?:if|else)\b</string>
</dict>
<dict>
<key>name</key>
<string>keyword.control.repeat.dosbatch</string>
<key>match</key>
<string>\b(?i)for\b</string>
</dict>
<dict>
<key>name</key>
<string>keyword.operator.dosbatch</string>
<key>match</key>
<string>\b(?:EQU|NEQ|LSS|LEQ|GTR|GEQ)\b</string>
</dict>
<dict>
<key>name</key>
<string>comment.line.rem.dosbatch</string>
<key>match</key>
<string>\b(?i)rem(?:$|\s.*$)</string>
</dict>
<dict>
<key>name</key>
<string>comment.line.colons.dosbatch</string>
<key>match</key>
<string>\s*:\s*:.*$</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>variable.parameter.function.begin.shell</string>
</dict>
</dict>
<key>name</key>
<string>variable.parameter.function.dosbatch</string>
<key>match</key>
<string>(?i)(%)(~(?:f|d|p|n|x|s|a|t|z|\$[^:]*:)*)?\d</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>variable.other.parsetime.begin.shell</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>variable.other.parsetime.end.shell</string>
</dict>
</dict>
<key>name</key>
<string>variable.other.parsetime.dosbatch</string>
<key>match</key>
<string>(%)[^%]+(%)|(%%)[^%]+(%%)</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>variable.parameter.loop.begin.shell</string>
</dict>
</dict>
<key>name</key>
<string>variable.parameter.loop.dosbatch</string>
<key>match</key>
<string>(?i)(%%)(~(?:f|d|p|n|x|s|a|t|z|\$[^:]*:)*)?[a-z]</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>variable.other.delayed.begin.shell</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>variable.other.delayed.end.shell</string>
</dict>
</dict>
<key>name</key>
<string>variable.other.delayed.dosbatch</string>
<key>match</key>
<string>(!)[^!]+(!)</string>
</dict>
<dict>
<key>begin</key>
<string>"</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.shell</string>
</dict>
</dict>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.shell</string>
</dict>
</dict>
<key>name</key>
<string>string.quoted.double.dosbatch</string>
<key>end</key>
<string>"|$</string>
</dict>
<dict>
<key>name</key>
<string>keyword.operator.pipe.dosbatch</string>
<key>match</key>
<string>[|]</string>
</dict>
<dict>
<key>name</key>
<string>keyword.operator.redirect.shell</string>
<key>match</key>
<string>&amp;&gt;|\d*&gt;&amp;\d*|\d*(&gt;&gt;|&gt;|&lt;)|\d*&lt;&amp;|\d*&lt;&gt;</string>
</dict>
</array>
<key>name</key>
<string>Batch File</string>
<key>scopeName</key>
<string>source.dosbatch</string>
<key>fileTypes</key>
<array>
<string>bat</string>
</array>
</dict>
</plist>

View File

@@ -4,13 +4,9 @@
"If you want to provide a fix or improvement, please create a pull request against the original repository.", "If you want to provide a fix or improvement, please create a pull request against the original repository.",
"Once accepted there, we are happy to receive an update request." "Once accepted there, we are happy to receive an update request."
], ],
"version": "https://github.com/mmims/language-batchfile/commit/40b605c75db3967a24b7015f6d3a885360b84e28", "version": "https://github.com/mmims/language-batchfile/commit/3dd105c31484e5975144478dac1aa91d8f51e528",
"scopeName": "source.batchfile",
"name": "Batch File", "name": "Batch File",
"fileTypes": [ "scopeName": "source.batchfile",
"bat",
"cmd"
],
"patterns": [ "patterns": [
{ {
"include": "#commands" "include": "#commands"
@@ -454,11 +450,15 @@
{ {
"begin": "\\(", "begin": "\\(",
"beginCaptures": { "beginCaptures": {
"0": "punctuation.section.group.begin.batchfile" "0": {
"name": "punctuation.section.group.begin.batchfile"
}
}, },
"end": "\\)", "end": "\\)",
"endCaptures": { "endCaptures": {
"0": "punctuation.section.group.end.batchfile" "0": {
"name": "punctuation.section.group.end.batchfile"
}
}, },
"name": "meta.group.batchfile", "name": "meta.group.batchfile",
"patterns": [ "patterns": [

View File

@@ -1,15 +0,0 @@
{
"name": "configuration-editing",
"version": "0.0.1",
"dependencies": {
"jsonc-parser": {
"version": "0.3.1",
"from": "jsonc-parser@0.3.1"
},
"vscode-nls": {
"version": "2.0.2",
"from": "vscode-nls@>=2.0.2 <3.0.0",
"resolved": "https://registry.npmjs.org/vscode-nls/-/vscode-nls-2.0.2.tgz"
}
}
}

View File

@@ -1,6 +1,8 @@
{ {
"name": "configuration-editing", "name": "configuration-editing",
"version": "0.0.1", "displayName": "%displayName%",
"description": "%description%",
"version": "1.0.0",
"publisher": "vscode", "publisher": "vscode",
"engines": { "engines": {
"vscode": "^1.0.0" "vscode": "^1.0.0"
@@ -10,7 +12,8 @@
"Other" "Other"
], ],
"activationEvents": [ "activationEvents": [
"onLanguage:json", "onLanguage:jsonc" "onLanguage:json",
"onLanguage:jsonc"
], ],
"main": "./out/extension", "main": "./out/extension",
"scripts": { "scripts": {
@@ -18,8 +21,8 @@
"watch": "gulp watch-extension:configuration-editing" "watch": "gulp watch-extension:configuration-editing"
}, },
"dependencies": { "dependencies": {
"jsonc-parser": "^0.3.1", "jsonc-parser": "^1.0.0",
"vscode-nls": "^2.0.1" "vscode-nls": "^3.2.1"
}, },
"contributes": { "contributes": {
"jsonValidation": [ "jsonValidation": [
@@ -67,6 +70,10 @@
"fileMatch": "%APP_SETTINGS_HOME%/snippets/*.json", "fileMatch": "%APP_SETTINGS_HOME%/snippets/*.json",
"url": "vscode://schemas/snippets" "url": "vscode://schemas/snippets"
}, },
{
"fileMatch": "**/*.code-snippets",
"url": "vscode://schemas/global-snippets"
},
{ {
"fileMatch": "/.vscode/extensions.json", "fileMatch": "/.vscode/extensions.json",
"url": "vscode://schemas/extensions" "url": "vscode://schemas/extensions"

View File

@@ -0,0 +1,4 @@
{
"displayName": "Configuration Editing",
"description": "Provides capabilities (advanced IntelliSense, auto-fixing) in configuration files like settings, launch and extension recommendation files."
}

View File

@@ -2,16 +2,14 @@
* Copyright (c) Microsoft Corporation. All rights reserved. * Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information. * Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
'use strict'; 'use strict';
import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();
import * as vscode from 'vscode'; import * as vscode from 'vscode';
import { getLocation, visit, parse } from 'jsonc-parser'; import { getLocation, visit, parse, ParseErrorCode } from 'jsonc-parser';
import * as path from 'path'; import * as path from 'path';
import { SettingsDocument } from './settingsDocumentHelper'; import { SettingsDocument } from './settingsDocumentHelper';
import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();
const decoration = vscode.window.createTextEditorDecorationType({ const decoration = vscode.window.createTextEditorDecorationType({
color: '#9e9e9e' color: '#9e9e9e'
@@ -20,7 +18,6 @@ const decoration = vscode.window.createTextEditorDecorationType({
let pendingLaunchJsonDecoration: NodeJS.Timer; let pendingLaunchJsonDecoration: NodeJS.Timer;
export function activate(context: vscode.ExtensionContext): void { export function activate(context: vscode.ExtensionContext): void {
//keybindings.json command-suggestions //keybindings.json command-suggestions
context.subscriptions.push(registerKeybindingsCompletions()); context.subscriptions.push(registerKeybindingsCompletions());
@@ -41,6 +38,45 @@ export function activate(context: vscode.ExtensionContext): void {
} }
}, null, context.subscriptions)); }, null, context.subscriptions));
updateLaunchJsonDecorations(vscode.window.activeTextEditor); updateLaunchJsonDecorations(vscode.window.activeTextEditor);
context.subscriptions.push(vscode.workspace.onWillSaveTextDocument(e => {
if (!e.document.fileName.endsWith('/settings.json')) {
return;
}
autoFixSettingsJSON(e);
}));
}
function autoFixSettingsJSON(willSaveEvent: vscode.TextDocumentWillSaveEvent): void {
const document = willSaveEvent.document;
const text = document.getText();
const edit = new vscode.WorkspaceEdit();
let lastEndOfSomething = -1;
visit(text, {
onArrayEnd(offset: number, length: number): void {
lastEndOfSomething = offset + length;
},
onLiteralValue(value: any, offset: number, length: number): void {
lastEndOfSomething = offset + length;
},
onObjectEnd(offset: number, length: number): void {
lastEndOfSomething = offset + length;
},
onError(error: ParseErrorCode, offset: number, length: number): void {
if (error === ParseErrorCode.CommaExpected && lastEndOfSomething > -1) {
const fixPosition = document.positionAt(lastEndOfSomething);
edit.insert(document.uri, fixPosition, ',');
}
}
});
willSaveEvent.waitUntil(
vscode.workspace.applyEdit(edit));
} }
function registerKeybindingsCompletions(): vscode.Disposable { function registerKeybindingsCompletions(): vscode.Disposable {

View File

@@ -60,26 +60,26 @@ export class SettingsDocument {
private provideFilesAssociationsCompletionItems(location: Location, range: vscode.Range): vscode.ProviderResult<vscode.CompletionItem[]> { private provideFilesAssociationsCompletionItems(location: Location, range: vscode.Range): vscode.ProviderResult<vscode.CompletionItem[]> {
const completions: vscode.CompletionItem[] = []; const completions: vscode.CompletionItem[] = [];
// Key if (location.path.length === 2) {
if (location.path.length === 1) { // Key
completions.push(this.newSnippetCompletionItem({ if (!location.isAtPropertyKey || location.path[1] === '') {
label: localize('assocLabelFile', "Files with Extension"), completions.push(this.newSnippetCompletionItem({
documentation: localize('assocDescriptionFile', "Map all files matching the glob pattern in their filename to the language with the given identifier."), label: localize('assocLabelFile', "Files with Extension"),
snippet: location.isAtPropertyKey ? '"*.${1:extension}": "${2:language}"' : '{ "*.${1:extension}": "${2:language}" }', documentation: localize('assocDescriptionFile', "Map all files matching the glob pattern in their filename to the language with the given identifier."),
range snippet: location.isAtPropertyKey ? '"*.${1:extension}": "${2:language}"' : '{ "*.${1:extension}": "${2:language}" }',
})); range
}));
completions.push(this.newSnippetCompletionItem({ completions.push(this.newSnippetCompletionItem({
label: localize('assocLabelPath', "Files with Path"), label: localize('assocLabelPath', "Files with Path"),
documentation: localize('assocDescriptionPath', "Map all files matching the absolute path glob pattern in their path to the language with the given identifier."), documentation: localize('assocDescriptionPath', "Map all files matching the absolute path glob pattern in their path to the language with the given identifier."),
snippet: location.isAtPropertyKey ? '"/${1:path to file}/*.${2:extension}": "${3:language}"' : '{ "/${1:path to file}/*.${2:extension}": "${3:language}" }', snippet: location.isAtPropertyKey ? '"/${1:path to file}/*.${2:extension}": "${3:language}"' : '{ "/${1:path to file}/*.${2:extension}": "${3:language}" }',
range range
})); }));
} } else {
// Value
// Value return this.provideLanguageCompletionItems(location, range);
else if (location.path.length === 2 && !location.isAtPropertyKey) { }
return this.provideLanguageCompletionItems(location, range);
} }
return Promise.resolve(completions); return Promise.resolve(completions);

View File

@@ -6,7 +6,8 @@
"lib": [ "lib": [
"es2015" "es2015"
], ],
"strict": true "strict": true,
"noUnusedLocals": true
}, },
"include": [ "include": [
"src/**/*" "src/**/*"

View File

@@ -6,12 +6,10 @@
version "7.0.4" version "7.0.4"
resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.4.tgz#9aabc135979ded383325749f508894c662948c8b" resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.4.tgz#9aabc135979ded383325749f508894c662948c8b"
jsonc-parser@^0.3.1: jsonc-parser@^1.0.0:
version "0.3.1" version "1.0.0"
resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-0.3.1.tgz#6ebf5c75224368d4b07ef4c26f9434e657472e95" resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-1.0.0.tgz#ddcc864ae708e60a7a6dd36daea00172fa8d9272"
dependencies:
vscode-nls "^2.0.2"
vscode-nls@^2.0.1, vscode-nls@^2.0.2: vscode-nls@^3.2.1:
version "2.0.2" version "3.2.1"
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-2.0.2.tgz#808522380844b8ad153499af5c3b03921aea02da" resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.2.1.tgz#b1f3e04e8a94a715d5a7bcbc8339c51e6d74ca51"

View File

@@ -1,107 +0,0 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/// <reference path="../src/typings/thenable.d.ts" />
// Declaring the following because the code gets compiled with es5, which lack definitions for console and timers.
declare var console: {
assert(value: any, message?: string, ...optionalParams: any[]): void;
dir(obj: any, options?: { showHidden?: boolean, depth?: number, colors?: boolean }): void;
error(message?: any, ...optionalParams: any[]): void;
info(message?: any, ...optionalParams: any[]): void;
log(message?: any, ...optionalParams: any[]): void;
time(label: string): void;
timeEnd(label: string): void;
trace(message?: any, ...optionalParams: any[]): void;
warn(message?: any, ...optionalParams: any[]): void;
};
// ---- ES6 promise ------------------------------------------------------
/**
* Represents the completion of an asynchronous operation.
*/
interface Promise<T> extends Thenable<T> {
/**
* Attaches callbacks for the resolution and/or rejection of the Promise.
* @param onfulfilled The callback to execute when the Promise is resolved.
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of which ever callback is executed.
*/
then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => TResult | Thenable<TResult>): Promise<TResult>;
then<TResult>(onfulfilled?: (value: T) => TResult | Thenable<TResult>, onrejected?: (reason: any) => void): Promise<TResult>;
/**
* Attaches a callback for only the rejection of the Promise.
* @param onrejected The callback to execute when the Promise is rejected.
* @returns A Promise for the completion of the callback.
*/
catch(onrejected?: (reason: any) => T | Thenable<T>): Promise<T>;
// [Symbol.toStringTag]: string;
}
interface PromiseConstructor {
// /**
// * A reference to the prototype.
// */
// prototype: Promise<any>;
/**
* Creates a new Promise.
* @param executor A callback used to initialize the promise. This callback is passed two arguments:
* a resolve callback used to resolve the promise with a value or the result of another promise,
* and a reject callback used to reject the promise with a provided reason or error.
*/
new <T>(executor: (resolve: (value?: T | Thenable<T>) => void, reject: (reason?: any) => void) => void): Promise<T>;
/**
* Creates a Promise that is resolved with an array of results when all of the provided Promises
* resolve, or rejected when any Promise is rejected.
* @param values An array of Promises.
* @returns A new Promise.
*/
all<T>(values: Array<T | Thenable<T>>): Promise<T[]>;
/**
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
* or rejected.
* @param values An array of Promises.
* @returns A new Promise.
*/
race<T>(values: Array<T | Thenable<T>>): Promise<T>;
/**
* Creates a new rejected promise for the provided reason.
* @param reason The reason the promise was rejected.
* @returns A new rejected Promise.
*/
reject(reason: any): Promise<void>;
/**
* Creates a new rejected promise for the provided reason.
* @param reason The reason the promise was rejected.
* @returns A new rejected Promise.
*/
reject<T>(reason: any): Promise<T>;
/**
* Creates a new resolved promise for the provided value.
* @param value A promise.
* @returns A promise whose internal state matches the provided promise.
*/
resolve<T>(value: T | Thenable<T>): Promise<T>;
/**
* Creates a new resolved promise.
* @returns A resolved promise.
*/
resolve(): Promise<void>;
// [Symbol.species]: Function;
}
declare var Promise: PromiseConstructor;

View File

@@ -1 +0,0 @@
test/**

View File

@@ -1,26 +0,0 @@
{
"name": "diff",
"version": "0.1.0",
"publisher": "vscode",
"engines": { "vscode": "*" },
"scripts": {
"update-grammar": "node ../../build/npm/update-grammar.js textmate/diff.tmbundle Syntaxes/Diff.plist ./syntaxes/diff.tmLanguage.json"
},
"contributes": {
"languages": [
{
"id": "diff",
"aliases": ["Diff", "diff" ],
"extensions": [".diff", ".patch", ".rej"],
"configuration": "./language-configuration.json"
}
],
"grammars": [
{
"language": "diff",
"scopeName": "source.diff",
"path": "./syntaxes/diff.tmLanguage.json"
}
]
}
}

View File

@@ -1,268 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>patch</string>
<string>diff</string>
<string>rej</string>
</array>
<key>firstLineMatch</key>
<string>(?x)^
(===\ modified\ file
|==== \s* // .+ \s - \s .+ \s+ ====
|Index:\
|---\ [^%\n]
|\*\*\*.*\d{4}\s*$
|\d+(,\d+)* (a|d|c) \d+(,\d+)* $
|diff\ --git\
|commit\ [0-9a-f]{40}$
)</string>
<key>keyEquivalent</key>
<string>^~D</string>
<key>name</key>
<string>Diff</string>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.separator.diff</string>
</dict>
</dict>
<key>match</key>
<string>^((\*{15})|(={67})|(-{3}))$\n?</string>
<key>name</key>
<string>meta.separator.diff</string>
</dict>
<dict>
<key>match</key>
<string>^\d+(,\d+)*(a|d|c)\d+(,\d+)*$\n?</string>
<key>name</key>
<string>meta.diff.range.normal</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.range.diff</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>meta.toc-list.line-number.diff</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>punctuation.definition.range.diff</string>
</dict>
</dict>
<key>match</key>
<string>^(@@)\s*(.+?)\s*(@@)($\n?)?</string>
<key>name</key>
<string>meta.diff.range.unified</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>3</key>
<dict>
<key>name</key>
<string>punctuation.definition.range.diff</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>punctuation.definition.range.diff</string>
</dict>
<key>6</key>
<dict>
<key>name</key>
<string>punctuation.definition.range.diff</string>
</dict>
<key>7</key>
<dict>
<key>name</key>
<string>punctuation.definition.range.diff</string>
</dict>
</dict>
<key>match</key>
<string>^(((\-{3}) .+ (\-{4}))|((\*{3}) .+ (\*{4})))$\n?</string>
<key>name</key>
<string>meta.diff.range.context</string>
</dict>
<dict>
<key>match</key>
<string>^diff --git a/.*$\n?</string>
<key>name</key>
<string>meta.diff.header.git</string>
</dict>
<dict>
<key>match</key>
<string>^diff (-|\S+\s+\S+).*$\n?</string>
<key>name</key>
<string>meta.diff.header.command</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>4</key>
<dict>
<key>name</key>
<string>punctuation.definition.from-file.diff</string>
</dict>
<key>6</key>
<dict>
<key>name</key>
<string>punctuation.definition.from-file.diff</string>
</dict>
<key>7</key>
<dict>
<key>name</key>
<string>punctuation.definition.from-file.diff</string>
</dict>
</dict>
<key>match</key>
<string>(^(((-{3}) .+)|((\*{3}) .+))$\n?|^(={4}) .+(?= - ))</string>
<key>name</key>
<string>meta.diff.header.from-file</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>2</key>
<dict>
<key>name</key>
<string>punctuation.definition.to-file.diff</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>punctuation.definition.to-file.diff</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>punctuation.definition.to-file.diff</string>
</dict>
</dict>
<key>match</key>
<string>(^(\+{3}) .+$\n?| (-) .* (={4})$\n?)</string>
<key>name</key>
<string>meta.diff.header.to-file</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>3</key>
<dict>
<key>name</key>
<string>punctuation.definition.inserted.diff</string>
</dict>
<key>6</key>
<dict>
<key>name</key>
<string>punctuation.definition.inserted.diff</string>
</dict>
</dict>
<key>match</key>
<string>^(((&gt;)( .*)?)|((\+).*))$\n?</string>
<key>name</key>
<string>markup.inserted.diff</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.inserted.diff</string>
</dict>
</dict>
<key>match</key>
<string>^(!).*$\n?</string>
<key>name</key>
<string>markup.changed.diff</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>3</key>
<dict>
<key>name</key>
<string>punctuation.definition.inserted.diff</string>
</dict>
<key>6</key>
<dict>
<key>name</key>
<string>punctuation.definition.inserted.diff</string>
</dict>
</dict>
<key>match</key>
<string>^(((&lt;)( .*)?)|((-).*))$\n?</string>
<key>name</key>
<string>markup.deleted.diff</string>
</dict>
<dict>
<key>begin</key>
<string>^(#)</string>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.diff</string>
</dict>
</dict>
<key>comment</key>
<string>Git produces unified diffs with embedded comments"</string>
<key>end</key>
<string>\n</string>
<key>name</key>
<string>comment.line.number-sign.diff</string>
</dict>
<dict>
<key>match</key>
<string>^index [0-9a-f]{7,40}\.\.[0-9a-f]{7,40}.*$\n?</string>
<key>name</key>
<string>meta.diff.index.git</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.separator.key-value.diff</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>meta.toc-list.file-name.diff</string>
</dict>
</dict>
<key>match</key>
<string>^Index(:) (.+)$\n?</string>
<key>name</key>
<string>meta.diff.index</string>
</dict>
<dict>
<key>match</key>
<string>^Only in .*: .*$\n?</string>
<key>name</key>
<string>meta.diff.only-in</string>
</dict>
</array>
<key>scopeName</key>
<string>source.diff</string>
<key>uuid</key>
<string>7E848FF4-708E-11D9-97B4-0011242E4184</string>
</dict>
</plist>

View File

@@ -1,19 +0,0 @@
--- lao Sat Jan 26 23:30:39 1991
+++ tzu Sat Jan 26 23:30:50 1991
@@ -1,7 +1,6 @@
-The Way that can be told of is not the eternal Way;
-The name that can be named is not the eternal name.
The Nameless is the origin of Heaven and Earth;
-The Named is the mother of all things.
+The named is the mother of all things.
+
Therefore let there always be non-being,
so we may see their subtlety,
And let there always be being,
@@ -9,3 +8,6 @@
The two are the same,
But after they are produced,
they have different names.
+They both may be called deep and profound.
+Deeper and more profound,
+The door of all subtleties!

View File

@@ -1,398 +0,0 @@
[
{
"c": "---",
"t": "source.diff meta.diff.header.from-file punctuation.definition.from-file.diff",
"r": {
"dark_plus": "meta.diff.header: #569CD6",
"light_plus": "meta.diff.header: #000080",
"dark_vs": "meta.diff.header: #569CD6",
"light_vs": "meta.diff.header: #000080",
"hc_black": "meta.diff.header: #000080"
}
},
{
"c": " lao\tSat Jan 26 23:30:39 1991",
"t": "source.diff meta.diff.header.from-file",
"r": {
"dark_plus": "meta.diff.header: #569CD6",
"light_plus": "meta.diff.header: #000080",
"dark_vs": "meta.diff.header: #569CD6",
"light_vs": "meta.diff.header: #000080",
"hc_black": "meta.diff.header: #000080"
}
},
{
"c": "+++",
"t": "source.diff meta.diff.header.to-file punctuation.definition.to-file.diff",
"r": {
"dark_plus": "meta.diff.header: #569CD6",
"light_plus": "meta.diff.header: #000080",
"dark_vs": "meta.diff.header: #569CD6",
"light_vs": "meta.diff.header: #000080",
"hc_black": "meta.diff.header: #000080"
}
},
{
"c": " tzu\tSat Jan 26 23:30:50 1991",
"t": "source.diff meta.diff.header.to-file",
"r": {
"dark_plus": "meta.diff.header: #569CD6",
"light_plus": "meta.diff.header: #000080",
"dark_vs": "meta.diff.header: #569CD6",
"light_vs": "meta.diff.header: #000080",
"hc_black": "meta.diff.header: #000080"
}
},
{
"c": "@@",
"t": "source.diff meta.diff.range.unified punctuation.definition.range.diff",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": " ",
"t": "source.diff meta.diff.range.unified",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "-1,7 +1,6",
"t": "source.diff meta.diff.range.unified meta.toc-list.line-number.diff",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": " ",
"t": "source.diff meta.diff.range.unified",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "@@",
"t": "source.diff meta.diff.range.unified punctuation.definition.range.diff",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "-",
"t": "source.diff markup.deleted.diff punctuation.definition.deleted.diff",
"r": {
"dark_plus": "markup.deleted: #CE9178",
"light_plus": "markup.deleted: #A31515",
"dark_vs": "markup.deleted: #CE9178",
"light_vs": "markup.deleted: #A31515",
"hc_black": "markup.deleted: #CE9178"
}
},
{
"c": "The Way that can be told of is not the eternal Way;",
"t": "source.diff markup.deleted.diff",
"r": {
"dark_plus": "markup.deleted: #CE9178",
"light_plus": "markup.deleted: #A31515",
"dark_vs": "markup.deleted: #CE9178",
"light_vs": "markup.deleted: #A31515",
"hc_black": "markup.deleted: #CE9178"
}
},
{
"c": "-",
"t": "source.diff markup.deleted.diff punctuation.definition.deleted.diff",
"r": {
"dark_plus": "markup.deleted: #CE9178",
"light_plus": "markup.deleted: #A31515",
"dark_vs": "markup.deleted: #CE9178",
"light_vs": "markup.deleted: #A31515",
"hc_black": "markup.deleted: #CE9178"
}
},
{
"c": "The name that can be named is not the eternal name.",
"t": "source.diff markup.deleted.diff",
"r": {
"dark_plus": "markup.deleted: #CE9178",
"light_plus": "markup.deleted: #A31515",
"dark_vs": "markup.deleted: #CE9178",
"light_vs": "markup.deleted: #A31515",
"hc_black": "markup.deleted: #CE9178"
}
},
{
"c": " The Nameless is the origin of Heaven and Earth;",
"t": "source.diff",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "-",
"t": "source.diff markup.deleted.diff punctuation.definition.deleted.diff",
"r": {
"dark_plus": "markup.deleted: #CE9178",
"light_plus": "markup.deleted: #A31515",
"dark_vs": "markup.deleted: #CE9178",
"light_vs": "markup.deleted: #A31515",
"hc_black": "markup.deleted: #CE9178"
}
},
{
"c": "The Named is the mother of all things.",
"t": "source.diff markup.deleted.diff",
"r": {
"dark_plus": "markup.deleted: #CE9178",
"light_plus": "markup.deleted: #A31515",
"dark_vs": "markup.deleted: #CE9178",
"light_vs": "markup.deleted: #A31515",
"hc_black": "markup.deleted: #CE9178"
}
},
{
"c": "+",
"t": "source.diff markup.inserted.diff punctuation.definition.inserted.diff",
"r": {
"dark_plus": "markup.inserted: #B5CEA8",
"light_plus": "markup.inserted: #09885A",
"dark_vs": "markup.inserted: #B5CEA8",
"light_vs": "markup.inserted: #09885A",
"hc_black": "markup.inserted: #B5CEA8"
}
},
{
"c": "The named is the mother of all things.",
"t": "source.diff markup.inserted.diff",
"r": {
"dark_plus": "markup.inserted: #B5CEA8",
"light_plus": "markup.inserted: #09885A",
"dark_vs": "markup.inserted: #B5CEA8",
"light_vs": "markup.inserted: #09885A",
"hc_black": "markup.inserted: #B5CEA8"
}
},
{
"c": "+",
"t": "source.diff markup.inserted.diff punctuation.definition.inserted.diff",
"r": {
"dark_plus": "markup.inserted: #B5CEA8",
"light_plus": "markup.inserted: #09885A",
"dark_vs": "markup.inserted: #B5CEA8",
"light_vs": "markup.inserted: #09885A",
"hc_black": "markup.inserted: #B5CEA8"
}
},
{
"c": " Therefore let there always be non-being,",
"t": "source.diff",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": " so we may see their subtlety,",
"t": "source.diff",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": " And let there always be being,",
"t": "source.diff",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "@@",
"t": "source.diff meta.diff.range.unified punctuation.definition.range.diff",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": " ",
"t": "source.diff meta.diff.range.unified",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "-9,3 +8,6",
"t": "source.diff meta.diff.range.unified meta.toc-list.line-number.diff",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": " ",
"t": "source.diff meta.diff.range.unified",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "@@",
"t": "source.diff meta.diff.range.unified punctuation.definition.range.diff",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": " The two are the same,",
"t": "source.diff",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": " But after they are produced,",
"t": "source.diff",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": " they have different names.",
"t": "source.diff",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "+",
"t": "source.diff markup.inserted.diff punctuation.definition.inserted.diff",
"r": {
"dark_plus": "markup.inserted: #B5CEA8",
"light_plus": "markup.inserted: #09885A",
"dark_vs": "markup.inserted: #B5CEA8",
"light_vs": "markup.inserted: #09885A",
"hc_black": "markup.inserted: #B5CEA8"
}
},
{
"c": "They both may be called deep and profound.",
"t": "source.diff markup.inserted.diff",
"r": {
"dark_plus": "markup.inserted: #B5CEA8",
"light_plus": "markup.inserted: #09885A",
"dark_vs": "markup.inserted: #B5CEA8",
"light_vs": "markup.inserted: #09885A",
"hc_black": "markup.inserted: #B5CEA8"
}
},
{
"c": "+",
"t": "source.diff markup.inserted.diff punctuation.definition.inserted.diff",
"r": {
"dark_plus": "markup.inserted: #B5CEA8",
"light_plus": "markup.inserted: #09885A",
"dark_vs": "markup.inserted: #B5CEA8",
"light_vs": "markup.inserted: #09885A",
"hc_black": "markup.inserted: #B5CEA8"
}
},
{
"c": "Deeper and more profound,",
"t": "source.diff markup.inserted.diff",
"r": {
"dark_plus": "markup.inserted: #B5CEA8",
"light_plus": "markup.inserted: #09885A",
"dark_vs": "markup.inserted: #B5CEA8",
"light_vs": "markup.inserted: #09885A",
"hc_black": "markup.inserted: #B5CEA8"
}
},
{
"c": "+",
"t": "source.diff markup.inserted.diff punctuation.definition.inserted.diff",
"r": {
"dark_plus": "markup.inserted: #B5CEA8",
"light_plus": "markup.inserted: #09885A",
"dark_vs": "markup.inserted: #B5CEA8",
"light_vs": "markup.inserted: #09885A",
"hc_black": "markup.inserted: #B5CEA8"
}
},
{
"c": "The door of all subtleties!",
"t": "source.diff markup.inserted.diff",
"r": {
"dark_plus": "markup.inserted: #B5CEA8",
"light_plus": "markup.inserted: #09885A",
"dark_vs": "markup.inserted: #B5CEA8",
"light_vs": "markup.inserted: #09885A",
"hc_black": "markup.inserted: #B5CEA8"
}
}
]

View File

@@ -1,6 +1,8 @@
{ {
"name": "docker", "name": "docker",
"version": "0.1.0", "displayName": "%displayName%",
"description": "%description%",
"version": "1.0.0",
"publisher": "vscode", "publisher": "vscode",
"engines": { "vscode": "*" }, "engines": { "vscode": "*" },
"scripts": { "scripts": {

View File

@@ -0,0 +1,4 @@
{
"displayName": "Docker Language Basics",
"description": "Provides syntax highlighting and bracket matching in Docker files."
}

View File

@@ -5,10 +5,8 @@
"Once accepted there, we are happy to receive an update request." "Once accepted there, we are happy to receive an update request."
], ],
"version": "https://github.com/moby/moby/commit/abd39744c6f3ed854500e423f5fabf952165161f", "version": "https://github.com/moby/moby/commit/abd39744c6f3ed854500e423f5fabf952165161f",
"fileTypes": [
"Dockerfile"
],
"name": "Dockerfile", "name": "Dockerfile",
"scopeName": "source.dockerfile",
"patterns": [ "patterns": [
{ {
"captures": { "captures": {
@@ -100,7 +98,5 @@
"comment": "comment.line", "comment": "comment.line",
"match": "^(\\s*)((#).*$\\n?)" "match": "^(\\s*)((#).*$\\n?)"
} }
], ]
"scopeName": "source.dockerfile",
"uuid": "a39d8795-59d2-49af-aa00-fe74ee29576e"
} }

View File

@@ -1,62 +0,0 @@
{
"name": "extension-editing",
"version": "0.0.1",
"dependencies": {
"@types/node": {
"version": "6.0.78",
"from": "@types/node@>=6.0.46 <7.0.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-6.0.78.tgz",
"dev": true
},
"argparse": {
"version": "1.0.9",
"from": "argparse@>=1.0.7 <2.0.0",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.9.tgz"
},
"entities": {
"version": "1.1.1",
"from": "entities@>=1.1.1 <1.2.0",
"resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz"
},
"jsonc-parser": {
"version": "0.3.1",
"from": "jsonc-parser@>=0.3.1 <0.4.0",
"resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-0.3.1.tgz"
},
"linkify-it": {
"version": "2.0.3",
"from": "linkify-it@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.0.3.tgz"
},
"markdown-it": {
"version": "8.3.1",
"from": "markdown-it@>=8.3.1 <9.0.0",
"resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-8.3.1.tgz"
},
"mdurl": {
"version": "1.0.1",
"from": "mdurl@>=1.0.1 <2.0.0",
"resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz"
},
"parse5": {
"version": "3.0.2",
"from": "parse5@>=3.0.2 <4.0.0",
"resolved": "https://registry.npmjs.org/parse5/-/parse5-3.0.2.tgz"
},
"sprintf-js": {
"version": "1.0.3",
"from": "sprintf-js@>=1.0.2 <1.1.0",
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz"
},
"uc.micro": {
"version": "1.0.3",
"from": "uc.micro@>=1.0.3 <2.0.0",
"resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.3.tgz"
},
"vscode-nls": {
"version": "2.0.2",
"from": "vscode-nls@>=2.0.1 <3.0.0",
"resolved": "https://registry.npmjs.org/vscode-nls/-/vscode-nls-2.0.2.tgz"
}
}
}

View File

@@ -1,6 +1,8 @@
{ {
"name": "extension-editing", "name": "extension-editing",
"version": "0.0.1", "displayName": "%displayName%",
"description": "%description%",
"version": "1.0.0",
"publisher": "vscode", "publisher": "vscode",
"engines": { "engines": {
"vscode": "^1.4.0" "vscode": "^1.4.0"
@@ -20,10 +22,10 @@
"watch": "gulp watch-extension:extension-editing" "watch": "gulp watch-extension:extension-editing"
}, },
"dependencies": { "dependencies": {
"jsonc-parser": "^0.3.1", "jsonc-parser": "^1.0.0",
"markdown-it": "^8.3.1", "markdown-it": "^8.3.1",
"parse5": "^3.0.2", "parse5": "^3.0.2",
"vscode-nls": "^2.0.1" "vscode-nls": "^3.2.1"
}, },
"contributes": { "contributes": {
"jsonValidation": [ "jsonValidation": [

View File

@@ -0,0 +1,4 @@
{
"displayName": "Package File Editing",
"description": "Provides IntelliSense for VS Code extension points and linting capabilities in package.json files."
}

View File

@@ -6,8 +6,10 @@
import * as fs from 'fs'; import * as fs from 'fs';
import * as path from 'path'; import * as path from 'path';
import { parseTree, findNodeAtLocation, Node as JsonNode } from 'jsonc-parser';
import * as nls from 'vscode-nls'; import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();
import { parseTree, findNodeAtLocation, Node as JsonNode } from 'jsonc-parser';
import * as MarkdownItType from 'markdown-it'; import * as MarkdownItType from 'markdown-it';
import { languages, workspace, Disposable, TextDocument, Uri, Diagnostic, Range, DiagnosticSeverity, Position } from 'vscode'; import { languages, workspace, Disposable, TextDocument, Uri, Diagnostic, Range, DiagnosticSeverity, Position } from 'vscode';
@@ -15,8 +17,6 @@ import { languages, workspace, Disposable, TextDocument, Uri, Diagnostic, Range,
const product = require('../../../product.json'); const product = require('../../../product.json');
const allowedBadgeProviders: string[] = (product.extensionAllowedBadgeProviders || []).map(s => s.toLowerCase()); const allowedBadgeProviders: string[] = (product.extensionAllowedBadgeProviders || []).map(s => s.toLowerCase());
const localize = nls.loadMessageBundle();
const httpsRequired = localize('httpsRequired', "Images must use the HTTPS protocol."); const httpsRequired = localize('httpsRequired', "Images must use the HTTPS protocol.");
const svgsNotValid = localize('svgsNotValid', "SVGs are not a valid image source."); const svgsNotValid = localize('svgsNotValid', "SVGs are not a valid image source.");
const embeddedSvgsNotValid = localize('embeddedSvgsNotValid', "Embedded SVGs are not a valid image source."); const embeddedSvgsNotValid = localize('embeddedSvgsNotValid', "Embedded SVGs are not a valid image source.");

View File

@@ -20,11 +20,9 @@ entities@~1.1.1:
version "1.1.1" version "1.1.1"
resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.1.tgz#6e5c2d0a5621b5dadaecef80b90edfb5cd7772f0" resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.1.tgz#6e5c2d0a5621b5dadaecef80b90edfb5cd7772f0"
jsonc-parser@^0.3.1: jsonc-parser@^1.0.0:
version "0.3.1" version "1.0.0"
resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-0.3.1.tgz#6ebf5c75224368d4b07ef4c26f9434e657472e95" resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-1.0.0.tgz#ddcc864ae708e60a7a6dd36daea00172fa8d9272"
dependencies:
vscode-nls "^2.0.2"
linkify-it@^2.0.0: linkify-it@^2.0.0:
version "2.0.3" version "2.0.3"
@@ -33,8 +31,8 @@ linkify-it@^2.0.0:
uc.micro "^1.0.1" uc.micro "^1.0.1"
markdown-it@^8.3.1: markdown-it@^8.3.1:
version "8.3.1" version "8.4.0"
resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-8.3.1.tgz#2f4b622948ccdc193d66f3ca2d43125ac4ac7323" resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-8.4.0.tgz#e2400881bf171f7018ed1bd9da441dac8af6306d"
dependencies: dependencies:
argparse "^1.0.7" argparse "^1.0.7"
entities "~1.1.1" entities "~1.1.1"
@@ -60,6 +58,6 @@ uc.micro@^1.0.1, uc.micro@^1.0.3:
version "1.0.3" version "1.0.3"
resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.3.tgz#7ed50d5e0f9a9fb0a573379259f2a77458d50192" resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.3.tgz#7ed50d5e0f9a9fb0a573379259f2a77458d50192"
vscode-nls@^2.0.1, vscode-nls@^2.0.2: vscode-nls@^3.2.1:
version "2.0.2" version "3.2.1"
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-2.0.2.tgz#808522380844b8ad153499af5c3b03921aea02da" resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.2.1.tgz#b1f3e04e8a94a715d5a7bcbc8339c51e6d74ca51"

View File

@@ -2,3 +2,4 @@ src/**
test/** test/**
out/test/** out/test/**
tsconfig.json tsconfig.json
build/**

View File

@@ -1,29 +1,52 @@
// ATTENTION - THIS DIRECTORY CONTAINS THIRD PARTY OPEN SOURCE MATERIALS: // ATTENTION - THIS DIRECTORY CONTAINS THIRD PARTY OPEN SOURCE MATERIALS:
[{ [
"name": "textmate/git.tmbundle", {
"version": "0.0.0", "name": "textmate/git.tmbundle",
"license": "MIT", "version": "0.0.0",
"repositoryURL": "https://github.com/textmate/git.tmbundle", "license": "MIT",
"licenseDetail": [ "repositoryURL": "https://github.com/textmate/git.tmbundle",
"Copyright (c) 2008 Tim Harper", "licenseDetail": [
"", "Copyright (c) 2008 Tim Harper",
"Permission is hereby granted, free of charge, to any person obtaining", "",
"a copy of this software and associated documentation files (the\"", "Permission is hereby granted, free of charge, to any person obtaining",
"Software\"), to deal in the Software without restriction, including", "a copy of this software and associated documentation files (the\"",
"without limitation the rights to use, copy, modify, merge, publish,", "Software\"), to deal in the Software without restriction, including",
"distribute, sublicense, and/or sell copies of the Software, and to", "without limitation the rights to use, copy, modify, merge, publish,",
"permit persons to whom the Software is furnished to do so, subject to", "distribute, sublicense, and/or sell copies of the Software, and to",
"the following conditions:", "permit persons to whom the Software is furnished to do so, subject to",
"", "the following conditions:",
"The above copyright notice and this permission notice shall be", "",
"included in all copies or substantial portions of the Software.", "The above copyright notice and this permission notice shall be",
"", "included in all copies or substantial portions of the Software.",
"THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,", "",
"EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF", "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,",
"MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND", "EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF",
"NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE", "MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND",
"LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION", "NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE",
"OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION", "LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION",
"WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE." "OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION",
] "WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
}] ]
},
{
"name": "textmate/diff.tmbundle",
"version": "0.0.0",
"license": "TextMate Bundle License",
"repositoryURL": "https://github.com/textmate/diff.tmbundle",
"licenseDetail": [
"Copyright (c) textmate-diff.tmbundle project authors",
"",
"If not otherwise specified (see below), files in this repository fall under the following license:",
"",
"Permission to copy, use, modify, sell and distribute this",
"software is granted. This software is provided \"as is\" without",
"express or implied warranty, and with no claim as to its",
"suitability for any purpose.",
"",
"An exception is made for files in readable text which contain their own license information,",
"or files where an accompanying file exists (in the same directory) with a \"-license\" suffix added",
"to the base-name name of the original file, and an extension of txt, html, or similar. For example",
"\"tidy\" is accompanied by \"tidy-license.txt\"."
]
}
]

2
extensions/git/README.md Normal file
View File

@@ -0,0 +1,2 @@
# Git integration for Visual Studio Code

View File

@@ -0,0 +1,16 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
var updateGrammar = require('../../../build/npm/update-grammar');
updateGrammar.update('textmate/git.tmbundle', 'Syntaxes/Git%20Commit%20Message.tmLanguage', './syntaxes/git-commit.tmLanguage.json');
updateGrammar.update('textmate/git.tmbundle', 'Syntaxes/Git%20Rebase%20Message.tmLanguage', './syntaxes/git-rebase.tmLanguage.json');
updateGrammar.update('textmate/diff.tmbundle', 'Syntaxes/Diff.plist', './syntaxes/diff.tmLanguage.json');

View File

@@ -1,7 +1,7 @@
{ {
"comments": { "comments": {
"lineComment": "//", "lineComment": "#",
"blockComment": [ "/*", "*/" ] "blockComment": [ "#", " " ]
}, },
"brackets": [ "brackets": [
["{", "}"], ["{", "}"],

View File

@@ -1,36 +0,0 @@
{
"name": "git",
"version": "0.0.1",
"dependencies": {
"applicationinsights": {
"version": "0.18.0",
"from": "applicationinsights@0.18.0",
"resolved": "https://registry.npmjs.org/applicationinsights/-/applicationinsights-0.18.0.tgz"
},
"byline": {
"version": "5.0.0",
"from": "byline@latest",
"resolved": "https://registry.npmjs.org/byline/-/byline-5.0.0.tgz"
},
"iconv-lite": {
"version": "0.4.15",
"from": "iconv-lite@0.4.15",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.15.tgz"
},
"vscode-extension-telemetry": {
"version": "0.0.8",
"from": "vscode-extension-telemetry@>=0.0.8 <0.0.9",
"resolved": "https://registry.npmjs.org/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.8.tgz"
},
"vscode-nls": {
"version": "2.0.2",
"from": "vscode-nls@>=2.0.1 <3.0.0",
"resolved": "https://registry.npmjs.org/vscode-nls/-/vscode-nls-2.0.2.tgz"
},
"winreg": {
"version": "1.2.3",
"from": "winreg@1.2.3",
"resolved": "https://registry.npmjs.org/winreg/-/winreg-1.2.3.tgz"
}
}
}

View File

@@ -1,9 +1,9 @@
{ {
"name": "git", "name": "git",
"displayName": "%displayName%",
"description": "%description%",
"publisher": "vscode", "publisher": "vscode",
"displayName": "git", "version": "1.0.0",
"description": "Git",
"version": "0.0.1",
"engines": { "engines": {
"vscode": "^1.5.0" "vscode": "^1.5.0"
}, },
@@ -16,9 +16,11 @@
"*" "*"
], ],
"main": "./out/main", "main": "./out/main",
"icon": "resources/icons/git.png",
"scripts": { "scripts": {
"compile": "gulp compile-extension:git", "compile": "gulp compile-extension:git",
"watch": "gulp watch-extension:git" "watch": "gulp watch-extension:git",
"update-grammar": "node ./build/update-grammars.js"
}, },
"contributes": { "contributes": {
"commands": [ "commands": [
@@ -68,6 +70,15 @@
"dark": "resources/icons/dark/open-file.svg" "dark": "resources/icons/dark/open-file.svg"
} }
}, },
{
"command": "git.openFile2",
"title": "%command.openFile%",
"category": "Git",
"icon": {
"light": "resources/icons/light/open-file-mono.svg",
"dark": "resources/icons/dark/open-file-mono.svg"
}
},
{ {
"command": "git.openHEADFile", "command": "git.openHEADFile",
"title": "%command.openHEADFile%", "title": "%command.openHEADFile%",
@@ -327,35 +338,35 @@
}, },
{ {
"command": "git.close", "command": "git.close",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.refresh", "command": "git.refresh",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.openFile", "command": "git.openFile",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.openHEADFile", "command": "git.openHEADFile",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.openChange", "command": "git.openChange",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.stage", "command": "git.stage",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.stageAll", "command": "git.stageAll",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.stageSelectedRanges", "command": "git.stageSelectedRanges",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.stageChange", "command": "git.stageChange",
@@ -363,155 +374,159 @@
}, },
{ {
"command": "git.revertSelectedRanges", "command": "git.revertSelectedRanges",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.revertChange", "command": "git.revertChange",
"when": "false" "when": "false"
}, },
{
"command": "git.openFile2",
"when": "false"
},
{ {
"command": "git.unstage", "command": "git.unstage",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.unstageAll", "command": "git.unstageAll",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.unstageSelectedRanges", "command": "git.unstageSelectedRanges",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.clean", "command": "git.clean",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0 && !gitFreshRepository"
}, },
{ {
"command": "git.cleanAll", "command": "git.cleanAll",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0 && !gitFreshRepository"
}, },
{ {
"command": "git.commit", "command": "git.commit",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.commitStaged", "command": "git.commitStaged",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.commitStagedSigned", "command": "git.commitStagedSigned",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.commitStagedAmend", "command": "git.commitStagedAmend",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.commitAll", "command": "git.commitAll",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.commitAllSigned", "command": "git.commitAllSigned",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.commitAllAmend", "command": "git.commitAllAmend",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.undoCommit", "command": "git.undoCommit",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.checkout", "command": "git.checkout",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.branch", "command": "git.branch",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.deleteBranch", "command": "git.deleteBranch",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.renameBranch", "command": "git.renameBranch",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.pull", "command": "git.pull",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.pullFrom", "command": "git.pullFrom",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.pullRebase", "command": "git.pullRebase",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.pullFrom", "command": "git.pullFrom",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.merge", "command": "git.merge",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.createTag", "command": "git.createTag",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.fetch", "command": "git.fetch",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.push", "command": "git.push",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.pushTo", "command": "git.pushTo",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.pushWithTags", "command": "git.pushWithTags",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.sync", "command": "git.sync",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.syncRebase", "command": "git.syncRebase",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.publish", "command": "git.publish",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.showOutput", "command": "git.showOutput",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled"
}, },
{ {
"command": "git.ignore", "command": "git.ignore",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.stashIncludeUntracked", "command": "git.stashIncludeUntracked",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.stash", "command": "git.stash",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.stashPop", "command": "git.stashPop",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
}, },
{ {
"command": "git.stashPopLatest", "command": "git.stashPopLatest",
"when": "gitOpenRepositoryCount != 0" "when": "config.git.enabled && gitOpenRepositoryCount != 0"
} }
], ],
"scm/title": [ "scm/title": [
@@ -618,7 +633,7 @@
{ {
"command": "git.cleanAll", "command": "git.cleanAll",
"group": "4_stage", "group": "4_stage",
"when": "scmProvider == git" "when": "scmProvider == git && !gitFreshRepository"
}, },
{ {
"command": "git.stashIncludeUntracked", "command": "git.stashIncludeUntracked",
@@ -676,7 +691,7 @@
}, },
{ {
"command": "git.cleanAll", "command": "git.cleanAll",
"when": "scmProvider == git && scmResourceGroup == workingTree", "when": "scmProvider == git && scmResourceGroup == workingTree && !gitFreshRepository",
"group": "1_modification" "group": "1_modification"
}, },
{ {
@@ -686,7 +701,7 @@
}, },
{ {
"command": "git.cleanAll", "command": "git.cleanAll",
"when": "scmProvider == git && scmResourceGroup == workingTree", "when": "scmProvider == git && scmResourceGroup == workingTree && !gitFreshRepository",
"group": "inline" "group": "inline"
}, },
{ {
@@ -701,11 +716,21 @@
"when": "scmProvider == git && scmResourceGroup == merge", "when": "scmProvider == git && scmResourceGroup == merge",
"group": "1_modification" "group": "1_modification"
}, },
{
"command": "git.openFile",
"when": "scmProvider == git && scmResourceGroup == merge",
"group": "navigation"
},
{ {
"command": "git.stage", "command": "git.stage",
"when": "scmProvider == git && scmResourceGroup == merge", "when": "scmProvider == git && scmResourceGroup == merge",
"group": "inline" "group": "inline"
}, },
{
"command": "git.openFile2",
"when": "scmProvider == git && scmResourceGroup == merge && config.git.showInlineOpenFileAction",
"group": "inline0"
},
{ {
"command": "git.openChange", "command": "git.openChange",
"when": "scmProvider == git && scmResourceGroup == index", "when": "scmProvider == git && scmResourceGroup == index",
@@ -731,6 +756,11 @@
"when": "scmProvider == git && scmResourceGroup == index", "when": "scmProvider == git && scmResourceGroup == index",
"group": "inline" "group": "inline"
}, },
{
"command": "git.openFile2",
"when": "scmProvider == git && scmResourceGroup == index && config.git.showInlineOpenFileAction",
"group": "inline0"
},
{ {
"command": "git.openChange", "command": "git.openChange",
"when": "scmProvider == git && scmResourceGroup == workingTree", "when": "scmProvider == git && scmResourceGroup == workingTree",
@@ -753,12 +783,12 @@
}, },
{ {
"command": "git.clean", "command": "git.clean",
"when": "scmProvider == git && scmResourceGroup == workingTree", "when": "scmProvider == git && scmResourceGroup == workingTree && !gitFreshRepository",
"group": "1_modification" "group": "1_modification"
}, },
{ {
"command": "git.clean", "command": "git.clean",
"when": "scmProvider == git && scmResourceGroup == workingTree", "when": "scmProvider == git && scmResourceGroup == workingTree && !gitFreshRepository",
"group": "inline" "group": "inline"
}, },
{ {
@@ -766,6 +796,11 @@
"when": "scmProvider == git && scmResourceGroup == workingTree", "when": "scmProvider == git && scmResourceGroup == workingTree",
"group": "inline" "group": "inline"
}, },
{
"command": "git.openFile2",
"when": "scmProvider == git && scmResourceGroup == workingTree && config.git.showInlineOpenFileAction",
"group": "inline0"
},
{ {
"command": "git.ignore", "command": "git.ignore",
"when": "scmProvider == git && scmResourceGroup == workingTree", "when": "scmProvider == git && scmResourceGroup == workingTree",
@@ -776,27 +811,27 @@
{ {
"command": "git.openFile", "command": "git.openFile",
"group": "navigation", "group": "navigation",
"when": "gitOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme != extension && resourceScheme != merge-conflict.conflict-diff" "when": "config.git.enabled && gitOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme =~ /^git$|^file$/"
}, },
{ {
"command": "git.openChange", "command": "git.openChange",
"group": "navigation", "group": "navigation",
"when": "gitOpenRepositoryCount != 0 && !isInDiffEditor && resourceScheme == file" "when": "config.git.enabled && gitOpenRepositoryCount != 0 && !isInDiffEditor && resourceScheme == file"
}, },
{ {
"command": "git.stageSelectedRanges", "command": "git.stageSelectedRanges",
"group": "2_git@1", "group": "2_git@1",
"when": "gitOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme != merge-conflict.conflict-diff" "when": "config.git.enabled && gitOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme =~ /^git$|^file$/"
}, },
{ {
"command": "git.unstageSelectedRanges", "command": "git.unstageSelectedRanges",
"group": "2_git@2", "group": "2_git@2",
"when": "gitOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme != merge-conflict.conflict-diff" "when": "config.git.enabled && gitOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme =~ /^git$|^file$/"
}, },
{ {
"command": "git.revertSelectedRanges", "command": "git.revertSelectedRanges",
"group": "2_git@3", "group": "2_git@3",
"when": "gitOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme != merge-conflict.conflict-diff" "when": "config.git.enabled && gitOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme =~ /^git$|^file$/"
} }
], ],
"scm/change/title": [ "scm/change/title": [
@@ -828,6 +863,11 @@
"default": null, "default": null,
"isExecutable": true "isExecutable": true
}, },
"git.autoRepositoryDetection": {
"type": "boolean",
"description": "%config.autoRepositoryDetection%",
"default": true
},
"git.autorefresh": { "git.autorefresh": {
"type": "boolean", "type": "boolean",
"description": "%config.autorefresh%", "description": "%config.autorefresh%",
@@ -898,6 +938,32 @@
"type": "boolean", "type": "boolean",
"default": true, "default": true,
"description": "%config.decorations.enabled%" "description": "%config.decorations.enabled%"
},
"git.promptToSaveFilesBeforeCommit": {
"type": "boolean",
"default": false,
"description": "%config.promptToSaveFilesBeforeCommit%"
},
"git.showInlineOpenFileAction": {
"type": "boolean",
"default": true,
"description": "%config.showInlineOpenFileAction%"
},
"git.inputValidation": {
"type": "string",
"enum": [
"always",
"warn",
"off"
],
"default": "warn",
"description": "%config.inputValidation%"
},
"git.detectSubmodules": {
"type": "boolean",
"scope": "resource",
"default": true,
"description": "%config.detectSubmodules%"
} }
} }
}, },
@@ -946,15 +1012,86 @@
"dark": "#6c6cc4", "dark": "#6c6cc4",
"highContrast": "#6c6cc4" "highContrast": "#6c6cc4"
} }
},
{
"id": "gitDecoration.submoduleResourceForeground",
"description": "%colors.submodule%",
"defaults": {
"light": "#1258a7",
"dark": "#8db9e2",
"highContrast": "#8db9e2"
}
} }
] ],
"languages": [
{
"id": "git-commit",
"aliases": [
"Git Commit Message",
"git-commit"
],
"filenames": [
"COMMIT_EDITMSG",
"MERGE_MSG"
],
"configuration": "./languages/git-commit.language-configuration.json"
},
{
"id": "git-rebase",
"aliases": [
"Git Rebase Message",
"git-rebase"
],
"filenames": [
"git-rebase-todo"
],
"configuration": "./languages/git-rebase.language-configuration.json"
},
{
"id": "diff",
"aliases": [
"Diff",
"diff"
],
"extensions": [
".patch",
".diff",
".rej"
],
"configuration": "./languages/diff.language-configuration.json"
}
],
"grammars": [
{
"language": "git-commit",
"scopeName": "text.git-commit",
"path": "./syntaxes/git-commit.tmLanguage.json"
},
{
"language": "git-rebase",
"scopeName": "text.git-rebase",
"path": "./syntaxes/git-rebase.tmLanguage.json"
},
{
"language": "diff",
"scopeName": "source.diff",
"path": "./syntaxes/diff.tmLanguage.json"
}
],
"configurationDefaults": {
"[git-commit]": {
"editor.rulers": [
72
]
}
}
}, },
"dependencies": { "dependencies": {
"byline": "^5.0.0", "byline": "^5.0.0",
"file-type": "^7.2.0", "file-type": "^7.2.0",
"iconv-lite": "0.4.19", "iconv-lite": "0.4.19",
"vscode-extension-telemetry": "0.0.8", "vscode-extension-telemetry": "0.0.15",
"vscode-nls": "2.0.2", "vscode-nls": "^3.2.1",
"which": "^1.3.0" "which": "^1.3.0"
}, },
"devDependencies": { "devDependencies": {

View File

@@ -1,4 +1,6 @@
{ {
"displayName": "Git",
"description": "Git SCM Integration",
"command.clone": "Clone", "command.clone": "Clone",
"command.init": "Initialize Repository", "command.init": "Initialize Repository",
"command.close": "Close Repository", "command.close": "Close Repository",
@@ -49,12 +51,13 @@
"command.stashPopLatest": "Pop Latest Stash", "command.stashPopLatest": "Pop Latest Stash",
"config.enabled": "Whether git is enabled", "config.enabled": "Whether git is enabled",
"config.path": "Path to the git executable", "config.path": "Path to the git executable",
"config.autoRepositoryDetection": "Whether repositories should be automatically detected",
"config.autorefresh": "Whether auto refreshing is enabled", "config.autorefresh": "Whether auto refreshing is enabled",
"config.autofetch": "Whether auto fetching is enabled", "config.autofetch": "Whether auto fetching is enabled",
"config.enableLongCommitWarning": "Whether long commit messages should be warned about", "config.enableLongCommitWarning": "Whether long commit messages should be warned about",
"config.confirmSync": "Confirm before synchronizing git repositories", "config.confirmSync": "Confirm before synchronizing git repositories",
"config.countBadge": "Controls the git badge counter. `all` counts all changes. `tracked` counts only the tracked changes. `off` turns it off.", "config.countBadge": "Controls the git badge counter. `all` counts all changes. `tracked` counts only the tracked changes. `off` turns it off.",
"config.checkoutType": "Controls what type of branches are listed when running `Checkout to...`. `all` shows all refs, `local` shows only the local branchs, `tags` shows only tags and `remote` shows only remote branches.", "config.checkoutType": "Controls what type of branches are listed when running `Checkout to...`. `all` shows all refs, `local` shows only the local branches, `tags` shows only tags and `remote` shows only remote branches.",
"config.ignoreLegacyWarning": "Ignores the legacy Git warning", "config.ignoreLegacyWarning": "Ignores the legacy Git warning",
"config.ignoreMissingGitWarning": "Ignores the warning when Git is missing", "config.ignoreMissingGitWarning": "Ignores the warning when Git is missing",
"config.ignoreLimitWarning": "Ignores the warning when there are too many changes in a repository", "config.ignoreLimitWarning": "Ignores the warning when there are too many changes in a repository",
@@ -63,9 +66,14 @@
"config.enableCommitSigning": "Enables commit signing with GPG.", "config.enableCommitSigning": "Enables commit signing with GPG.",
"config.discardAllScope": "Controls what changes are discarded by the `Discard all changes` command. `all` discards all changes. `tracked` discards only tracked files. `prompt` shows a prompt dialog every time the action is run.", "config.discardAllScope": "Controls what changes are discarded by the `Discard all changes` command. `all` discards all changes. `tracked` discards only tracked files. `prompt` shows a prompt dialog every time the action is run.",
"config.decorations.enabled": "Controls if Git contributes colors and badges to the explorer and the open editors view.", "config.decorations.enabled": "Controls if Git contributes colors and badges to the explorer and the open editors view.",
"config.promptToSaveFilesBeforeCommit": "Controls whether Git should check for unsaved files before committing.",
"config.showInlineOpenFileAction": "Controls whether to show an inline Open File action in the Git changes view.",
"config.inputValidation": "Controls when to show commit message input validation.",
"config.detectSubmodules": "Controls whether to automatically detect git submodules.",
"colors.modified": "Color for modified resources.", "colors.modified": "Color for modified resources.",
"colors.deleted": "Color for deleted resources.", "colors.deleted": "Color for deleted resources.",
"colors.untracked": "Color for untracked resources.", "colors.untracked": "Color for untracked resources.",
"colors.ignored": "Color for ignored resources.", "colors.ignored": "Color for ignored resources.",
"colors.conflict": "Color for resources with conflicts." "colors.conflict": "Color for resources with conflicts.",
"colors.submodule": "Color for submodule resources."
} }

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><polygon fill="#C5C5C5" points="10,2 7.414,2 8.414,3 9,3 9,3.586 9,4 9,4.414 9,6 12,6 12,13 4,13 4,8 3,8 3,14 13,14 13,5"/><polygon fill="#C5C5C5" points="5,1 3,1 5,3 1,3 1,5 5,5 3,7 5,7 8,4"/></svg>

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><polygon fill="#424242" points="10,2 7.414,2 8.414,3 9,3 9,3.586 9,4 9,4.414 9,6 12,6 12,13 4,13 4,8 3,8 3,14 13,14 13,5"/><polygon fill="#424242" points="5,1 3,1 5,3 1,3 1,5 5,5 3,7 5,7 8,4"/></svg>

After

Width:  |  Height:  |  Size: 262 B

View File

@@ -1,3 +1 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [ <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><polygon fill="#656565" points="10,2 7.414,2 8.414,3 9,3 9,3.586 9,4 9,4.414 9,6 12,6 12,13 4,13 4,8 3,8 3,14 13,14 13,5"/><polygon fill="#00539C" points="5,1 3,1 5,3 1,3 1,5 5,5 3,7 5,7 8,4"/></svg>
<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
]><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><polygon fill="#656565" points="10,2 7.414,2 8.414,3 9,3 9,3.586 9,4 9,4.414 9,6 12,6 12,13 4,13 4,8 3,8 3,14 13,14 13,5"/><polygon fill="#00539C" points="5,1 3,1 5,3 1,3 1,5 5,5 3,7 5,7 8,4"/></svg>

Before

Width:  |  Height:  |  Size: 417 B

After

Width:  |  Height:  |  Size: 262 B

View File

@@ -6,7 +6,7 @@
'use strict'; 'use strict';
import { Model } from './model'; import { Model } from './model';
import { SourceControlInputBox, Uri } from 'vscode'; import { Uri } from 'vscode';
export interface InputBox { export interface InputBox {
value: string; value: string;

View File

@@ -5,7 +5,7 @@
'use strict'; 'use strict';
import { workspace, Disposable, EventEmitter, Memento, window, MessageItem, ConfigurationTarget, commands, Uri } from 'vscode'; import { workspace, Disposable, EventEmitter, Memento, window, MessageItem, ConfigurationTarget } from 'vscode';
import { GitErrorCodes } from './git'; import { GitErrorCodes } from './git';
import { Repository, Operation } from './repository'; import { Repository, Operation } from './repository';
import { eventToPromise, filterEvent, onceEvent } from './util'; import { eventToPromise, filterEvent, onceEvent } from './util';
@@ -54,20 +54,14 @@ export class AutoFetcher {
} }
const yes: MessageItem = { title: localize('yes', "Yes") }; const yes: MessageItem = { title: localize('yes', "Yes") };
const readMore: MessageItem = { title: localize('read more', "Read More") };
const no: MessageItem = { isCloseAffordance: true, title: localize('no', "No") }; const no: MessageItem = { isCloseAffordance: true, title: localize('no', "No") };
const askLater: MessageItem = { title: localize('not now', "Ask Me Later") }; const askLater: MessageItem = { title: localize('not now', "Ask Me Later") };
const result = await window.showInformationMessage(localize('suggest auto fetch', "Would you like Code to periodically run `git fetch`?"), yes, readMore, no, askLater); const result = await window.showInformationMessage(localize('suggest auto fetch', "Would you like Code to [periodically run 'git fetch']({0})?", 'https://go.microsoft.com/fwlink/?linkid=865294'), yes, no, askLater);
if (result === askLater) { if (result === askLater) {
return; return;
} }
if (result === readMore) {
commands.executeCommand('vscode.open', Uri.parse('https://go.microsoft.com/fwlink/?linkid=865294'));
return this.onFirstGoodRemoteOperation();
}
if (result === yes) { if (result === yes) {
const gitConfig = workspace.getConfiguration('git'); const gitConfig = workspace.getConfiguration('git');
gitConfig.update('autofetch', true, ConfigurationTarget.Global); gitConfig.update('autofetch', true, ConfigurationTarget.Global);

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