mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-13 17:22:15 -05:00
Vscode merge (#4582)
* Merge from vscode 37cb23d3dd4f9433d56d4ba5ea3203580719a0bd * fix issues with merges * bump node version in azpipe * replace license headers * remove duplicate launch task * fix build errors * fix build errors * fix tslint issues * working through package and linux build issues * more work * wip * fix packaged builds * working through linux build errors * wip * wip * wip * fix mac and linux file limits * iterate linux pipeline * disable editor typing * revert series to parallel * remove optimize vscode from linux * fix linting issues * revert testing change * add work round for new node * readd packaging for extensions * fix issue with angular not resolving decorator dependencies
This commit is contained in:
14
.vscode/settings.json
vendored
14
.vscode/settings.json
vendored
@@ -44,11 +44,17 @@
|
|||||||
"emmet.excludeLanguages": [],
|
"emmet.excludeLanguages": [],
|
||||||
"typescript.preferences.importModuleSpecifier": "non-relative",
|
"typescript.preferences.importModuleSpecifier": "non-relative",
|
||||||
"typescript.preferences.quoteStyle": "single",
|
"typescript.preferences.quoteStyle": "single",
|
||||||
"json.schemas": [{
|
"json.schemas": [
|
||||||
"fileMatch": [ "cgmanifest.json" ],
|
{
|
||||||
|
"fileMatch": [
|
||||||
|
"cgmanifest.json"
|
||||||
|
],
|
||||||
"url": "./.vscode/cgmanifest.schema.json"
|
"url": "./.vscode/cgmanifest.schema.json"
|
||||||
}, {
|
},
|
||||||
"fileMatch": [ "cglicenses.json" ],
|
{
|
||||||
|
"fileMatch": [
|
||||||
|
"cglicenses.json"
|
||||||
|
],
|
||||||
"url": "./.vscode/cglicenses.schema.json"
|
"url": "./.vscode/cglicenses.schema.json"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|||||||
2
.yarnrc
2
.yarnrc
@@ -1,3 +1,3 @@
|
|||||||
disturl "https://atom.io/download/electron"
|
disturl "https://atom.io/download/electron"
|
||||||
target "3.1.2"
|
target "3.1.6"
|
||||||
runtime "electron"
|
runtime "electron"
|
||||||
|
|||||||
@@ -343,32 +343,6 @@ END OF emmet NOTICES AND INFORMATION
|
|||||||
=========================================
|
=========================================
|
||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2015 JD Ballard
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
=========================================
|
|
||||||
END OF error-ex NOTICES AND INFORMATION
|
|
||||||
|
|
||||||
%% escape-string-regexp NOTICES AND INFORMATION BEGIN HERE
|
|
||||||
=========================================
|
|
||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ steps:
|
|||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
git submodule update --init --recursive
|
git submodule update --init --recursive
|
||||||
nvm install 8.9.1
|
nvm install 10.15.1
|
||||||
nvm use 8.9.1
|
nvm use 10.15.1
|
||||||
npm i -g yarn
|
npm i -g yarn
|
||||||
displayName: 'preinstall'
|
displayName: 'preinstall'
|
||||||
|
|
||||||
@@ -29,7 +29,6 @@ steps:
|
|||||||
- script: |
|
- script: |
|
||||||
node_modules/.bin/gulp electron
|
node_modules/.bin/gulp electron
|
||||||
node_modules/.bin/gulp compile --max_old_space_size=4096
|
node_modules/.bin/gulp compile --max_old_space_size=4096
|
||||||
node_modules/.bin/gulp optimize-vscode --max_old_space_size=4096
|
|
||||||
displayName: 'Scripts'
|
displayName: 'Scripts'
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
steps:
|
steps:
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: '8.9'
|
versionSpec: '10.15.1'
|
||||||
displayName: 'Install Node.js'
|
displayName: 'Install Node.js'
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
|
|||||||
@@ -154,9 +154,13 @@ async function publish(commit: string, quality: string, platform: string, type:
|
|||||||
|
|
||||||
const queuedBy = process.env['BUILD_QUEUEDBY']!;
|
const queuedBy = process.env['BUILD_QUEUEDBY']!;
|
||||||
const sourceBranch = process.env['BUILD_SOURCEBRANCH']!;
|
const sourceBranch = process.env['BUILD_SOURCEBRANCH']!;
|
||||||
const isReleased = quality === 'insider'
|
const isReleased = (
|
||||||
&& /^master$|^refs\/heads\/master$/.test(sourceBranch)
|
// Insiders: nightly build from master
|
||||||
&& /Project Collection Service Accounts|Microsoft.VisualStudio.Services.TFS/.test(queuedBy);
|
(quality === 'insider' && /^master$|^refs\/heads\/master$/.test(sourceBranch) && /Project Collection Service Accounts|Microsoft.VisualStudio.Services.TFS/.test(queuedBy)) ||
|
||||||
|
|
||||||
|
// Exploration: any build from electron-4.0.x branch
|
||||||
|
(quality === 'exploration' && /^electron-4.0.x$|^refs\/heads\/electron-4.0.x$/.test(sourceBranch))
|
||||||
|
);
|
||||||
|
|
||||||
console.log('Publishing...');
|
console.log('Publishing...');
|
||||||
console.log('Quality:', quality);
|
console.log('Quality:', quality);
|
||||||
|
|||||||
@@ -1,13 +1,25 @@
|
|||||||
steps:
|
steps:
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "8.12.0"
|
versionSpec: "10.15.1"
|
||||||
|
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
|
||||||
|
inputs:
|
||||||
|
keyfile: '**/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
|
||||||
|
targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
|
||||||
|
vstsFeed: '$(ArtifactFeed)'
|
||||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "1.10.1"
|
versionSpec: "1.10.1"
|
||||||
- script: |
|
- script: |
|
||||||
yarn
|
yarn
|
||||||
displayName: Install Dependencies
|
displayName: Install Dependencies
|
||||||
|
condition: ne(variables['CacheRestored'], 'true')
|
||||||
|
- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
|
||||||
|
inputs:
|
||||||
|
keyfile: '**/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
|
||||||
|
targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
|
||||||
|
vstsFeed: '$(ArtifactFeed)'
|
||||||
|
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
|
||||||
- script: |
|
- script: |
|
||||||
yarn gulp electron-x64
|
yarn gulp electron-x64
|
||||||
displayName: Download Electron
|
displayName: Download Electron
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
steps:
|
steps:
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "8.12.0"
|
versionSpec: "10.15.1"
|
||||||
|
|
||||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
inputs:
|
inputs:
|
||||||
@@ -23,7 +23,10 @@ steps:
|
|||||||
set -e
|
set -e
|
||||||
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" \
|
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" \
|
||||||
AZURE_STORAGE_ACCESS_KEY="$(AZURE_STORAGE_ACCESS_KEY)" \
|
AZURE_STORAGE_ACCESS_KEY="$(AZURE_STORAGE_ACCESS_KEY)" \
|
||||||
yarn gulp -- vscode-darwin-min upload-vscode-sourcemaps
|
yarn gulp -- vscode-darwin-min
|
||||||
|
VSCODE_MIXIN_PASSWORD="$(VSCODE_MIXIN_PASSWORD)" \
|
||||||
|
AZURE_STORAGE_ACCESS_KEY="$(AZURE_STORAGE_ACCESS_KEY)" \
|
||||||
|
yarn gulp -- upload-vscode-sourcemaps
|
||||||
displayName: Build
|
displayName: Build
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
|
|||||||
@@ -9,13 +9,25 @@ steps:
|
|||||||
sudo service xvfb start
|
sudo service xvfb start
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "8.12.0"
|
versionSpec: "10.15.1"
|
||||||
|
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
|
||||||
|
inputs:
|
||||||
|
keyfile: '**/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
|
||||||
|
targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
|
||||||
|
vstsFeed: '$(ArtifactFeed)'
|
||||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "1.10.1"
|
versionSpec: "1.10.1"
|
||||||
- script: |
|
- script: |
|
||||||
yarn
|
yarn
|
||||||
displayName: Install Dependencies
|
displayName: Install Dependencies
|
||||||
|
condition: ne(variables['CacheRestored'], 'true')
|
||||||
|
- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
|
||||||
|
inputs:
|
||||||
|
keyfile: '**/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
|
||||||
|
targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
|
||||||
|
vstsFeed: '$(ArtifactFeed)'
|
||||||
|
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
|
||||||
- script: |
|
- script: |
|
||||||
yarn gulp electron-x64
|
yarn gulp electron-x64
|
||||||
displayName: Download Electron
|
displayName: Download Electron
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
steps:
|
steps:
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "8.12.0"
|
versionSpec: "10.15.1"
|
||||||
|
|
||||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
inputs:
|
inputs:
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
steps:
|
steps:
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "8.12.0"
|
versionSpec: "10.15.1"
|
||||||
|
|
||||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
inputs:
|
inputs:
|
||||||
@@ -16,6 +16,11 @@ steps:
|
|||||||
- script: |
|
- script: |
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
# Make sure we get latest packages
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get upgrade -y
|
||||||
|
|
||||||
|
# Define variables
|
||||||
REPO="$(pwd)"
|
REPO="$(pwd)"
|
||||||
ARCH="$(VSCODE_ARCH)"
|
ARCH="$(VSCODE_ARCH)"
|
||||||
SNAP_ROOT="$REPO/.build/linux/snap/$ARCH"
|
SNAP_ROOT="$REPO/.build/linux/snap/$ARCH"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
steps:
|
steps:
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "8.12.0"
|
versionSpec: "10.15.1"
|
||||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "1.10.1"
|
versionSpec: "1.10.1"
|
||||||
@@ -9,9 +9,21 @@ steps:
|
|||||||
inputs:
|
inputs:
|
||||||
versionSpec: '2.x'
|
versionSpec: '2.x'
|
||||||
addToPath: true
|
addToPath: true
|
||||||
|
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
|
||||||
|
inputs:
|
||||||
|
keyfile: '**/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
|
||||||
|
targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
|
||||||
|
vstsFeed: '$(ArtifactFeed)'
|
||||||
- powershell: |
|
- powershell: |
|
||||||
yarn
|
yarn
|
||||||
displayName: Install Dependencies
|
displayName: Install Dependencies
|
||||||
|
condition: ne(variables['CacheRestored'], 'true')
|
||||||
|
- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
|
||||||
|
inputs:
|
||||||
|
keyfile: '**/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
|
||||||
|
targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
|
||||||
|
vstsFeed: '$(ArtifactFeed)'
|
||||||
|
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
|
||||||
- powershell: |
|
- powershell: |
|
||||||
yarn gulp electron
|
yarn gulp electron
|
||||||
displayName: Download Electron
|
displayName: Download Electron
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
steps:
|
steps:
|
||||||
- task: NodeTool@0
|
- task: NodeTool@0
|
||||||
inputs:
|
inputs:
|
||||||
versionSpec: "8.12.0"
|
versionSpec: "10.15.1"
|
||||||
|
|
||||||
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
|
||||||
inputs:
|
inputs:
|
||||||
|
|||||||
91
build/download/download.js
Normal file
91
build/download/download.js
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
"use strict";
|
||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const https = require("https");
|
||||||
|
const fs = require("fs");
|
||||||
|
const path = require("path");
|
||||||
|
const cp = require("child_process");
|
||||||
|
function ensureDir(filepath) {
|
||||||
|
if (!fs.existsSync(filepath)) {
|
||||||
|
ensureDir(path.dirname(filepath));
|
||||||
|
fs.mkdirSync(filepath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function download(options, destination) {
|
||||||
|
ensureDir(path.dirname(destination));
|
||||||
|
return new Promise((c, e) => {
|
||||||
|
const fd = fs.openSync(destination, 'w');
|
||||||
|
const req = https.get(options, (res) => {
|
||||||
|
res.on('data', (chunk) => {
|
||||||
|
fs.writeSync(fd, chunk);
|
||||||
|
});
|
||||||
|
res.on('end', () => {
|
||||||
|
fs.closeSync(fd);
|
||||||
|
c();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
req.on('error', (reqErr) => {
|
||||||
|
console.error(`request to ${options.host}${options.path} failed.`);
|
||||||
|
console.error(reqErr);
|
||||||
|
e(reqErr);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
const MARKER_ARGUMENT = `_download_fork_`;
|
||||||
|
function base64encode(str) {
|
||||||
|
return Buffer.from(str, 'utf8').toString('base64');
|
||||||
|
}
|
||||||
|
function base64decode(str) {
|
||||||
|
return Buffer.from(str, 'base64').toString('utf8');
|
||||||
|
}
|
||||||
|
function downloadInExternalProcess(options) {
|
||||||
|
const url = `https://${options.requestOptions.host}${options.requestOptions.path}`;
|
||||||
|
console.log(`Downloading ${url}...`);
|
||||||
|
return new Promise((c, e) => {
|
||||||
|
const child = cp.fork(__filename, [MARKER_ARGUMENT, base64encode(JSON.stringify(options))], {
|
||||||
|
stdio: ['pipe', 'pipe', 'pipe', 'ipc']
|
||||||
|
});
|
||||||
|
let stderr = [];
|
||||||
|
child.stderr.on('data', (chunk) => {
|
||||||
|
stderr.push(typeof chunk === 'string' ? Buffer.from(chunk) : chunk);
|
||||||
|
});
|
||||||
|
child.on('exit', (code) => {
|
||||||
|
if (code === 0) {
|
||||||
|
// normal termination
|
||||||
|
console.log(`Finished downloading ${url}.`);
|
||||||
|
c();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// abnormal termination
|
||||||
|
console.error(Buffer.concat(stderr).toString());
|
||||||
|
e(new Error(`Download of ${url} failed.`));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.downloadInExternalProcess = downloadInExternalProcess;
|
||||||
|
function _downloadInExternalProcess() {
|
||||||
|
let options;
|
||||||
|
try {
|
||||||
|
options = JSON.parse(base64decode(process.argv[3]));
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.error(`Cannot read arguments`);
|
||||||
|
console.error(err);
|
||||||
|
process.exit(-1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
download(options.requestOptions, options.destinationPath).then(() => {
|
||||||
|
process.exit(0);
|
||||||
|
}, (err) => {
|
||||||
|
console.error(err);
|
||||||
|
process.exit(-2);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (process.argv.length >= 4 && process.argv[2] === MARKER_ARGUMENT) {
|
||||||
|
// running as forked download script
|
||||||
|
_downloadInExternalProcess();
|
||||||
|
}
|
||||||
111
build/download/download.ts
Normal file
111
build/download/download.ts
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||||
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
import * as https from 'https';
|
||||||
|
import * as fs from 'fs';
|
||||||
|
import * as path from 'path';
|
||||||
|
import * as cp from 'child_process';
|
||||||
|
|
||||||
|
function ensureDir(filepath: string) {
|
||||||
|
if (!fs.existsSync(filepath)) {
|
||||||
|
ensureDir(path.dirname(filepath));
|
||||||
|
fs.mkdirSync(filepath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function download(options: https.RequestOptions, destination: string): Promise<void> {
|
||||||
|
ensureDir(path.dirname(destination));
|
||||||
|
|
||||||
|
return new Promise<void>((c, e) => {
|
||||||
|
const fd = fs.openSync(destination, 'w');
|
||||||
|
const req = https.get(options, (res) => {
|
||||||
|
res.on('data', (chunk) => {
|
||||||
|
fs.writeSync(fd, chunk);
|
||||||
|
});
|
||||||
|
res.on('end', () => {
|
||||||
|
fs.closeSync(fd);
|
||||||
|
c();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
req.on('error', (reqErr) => {
|
||||||
|
console.error(`request to ${options.host}${options.path} failed.`);
|
||||||
|
console.error(reqErr);
|
||||||
|
e(reqErr);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const MARKER_ARGUMENT = `_download_fork_`;
|
||||||
|
|
||||||
|
function base64encode(str: string): string {
|
||||||
|
return Buffer.from(str, 'utf8').toString('base64');
|
||||||
|
}
|
||||||
|
|
||||||
|
function base64decode(str: string): string {
|
||||||
|
return Buffer.from(str, 'base64').toString('utf8');
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IDownloadRequestOptions {
|
||||||
|
host: string;
|
||||||
|
path: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IDownloadOptions {
|
||||||
|
requestOptions: IDownloadRequestOptions;
|
||||||
|
destinationPath: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function downloadInExternalProcess(options: IDownloadOptions): Promise<void> {
|
||||||
|
const url = `https://${options.requestOptions.host}${options.requestOptions.path}`;
|
||||||
|
console.log(`Downloading ${url}...`);
|
||||||
|
return new Promise<void>((c, e) => {
|
||||||
|
const child = cp.fork(
|
||||||
|
__filename,
|
||||||
|
[MARKER_ARGUMENT, base64encode(JSON.stringify(options))],
|
||||||
|
{
|
||||||
|
stdio: ['pipe', 'pipe', 'pipe', 'ipc']
|
||||||
|
}
|
||||||
|
);
|
||||||
|
let stderr: Buffer[] = [];
|
||||||
|
child.stderr.on('data', (chunk) => {
|
||||||
|
stderr.push(typeof chunk === 'string' ? Buffer.from(chunk) : chunk);
|
||||||
|
});
|
||||||
|
child.on('exit', (code) => {
|
||||||
|
if (code === 0) {
|
||||||
|
// normal termination
|
||||||
|
console.log(`Finished downloading ${url}.`);
|
||||||
|
c();
|
||||||
|
} else {
|
||||||
|
// abnormal termination
|
||||||
|
console.error(Buffer.concat(stderr).toString());
|
||||||
|
e(new Error(`Download of ${url} failed.`));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function _downloadInExternalProcess() {
|
||||||
|
let options: IDownloadOptions;
|
||||||
|
try {
|
||||||
|
options = JSON.parse(base64decode(process.argv[3]));
|
||||||
|
} catch (err) {
|
||||||
|
console.error(`Cannot read arguments`);
|
||||||
|
console.error(err);
|
||||||
|
process.exit(-1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
download(options.requestOptions, options.destinationPath).then(() => {
|
||||||
|
process.exit(0);
|
||||||
|
}, (err) => {
|
||||||
|
console.error(err);
|
||||||
|
process.exit(-2);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (process.argv.length >= 4 && process.argv[2] === MARKER_ARGUMENT) {
|
||||||
|
// running as forked download script
|
||||||
|
_downloadInExternalProcess();
|
||||||
|
}
|
||||||
18
build/gulpfile.compile.js
Normal file
18
build/gulpfile.compile.js
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* 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 util = require('./lib/util');
|
||||||
|
const task = require('./lib/task');
|
||||||
|
const compilation = require('./lib/compilation');
|
||||||
|
const { compileExtensionsBuildTask } = require('./gulpfile.extensions');
|
||||||
|
|
||||||
|
// Full compile, including nls and inline sources in sourcemaps, for build
|
||||||
|
const compileClientBuildTask = task.define('compile-client-build', task.series(util.rimraf('out-build'), compilation.compileTask('src', 'out-build', true)));
|
||||||
|
|
||||||
|
// All Build
|
||||||
|
const compileBuildTask = task.define('compile-build', task.parallel(compileClientBuildTask, compileExtensionsBuildTask));
|
||||||
|
exports.compileBuildTask = compileBuildTask;
|
||||||
@@ -6,6 +6,7 @@
|
|||||||
const gulp = require('gulp');
|
const gulp = require('gulp');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const util = require('./lib/util');
|
const util = require('./lib/util');
|
||||||
|
const task = require('./lib/task');
|
||||||
const common = require('./lib/optimize');
|
const common = require('./lib/optimize');
|
||||||
const es = require('event-stream');
|
const es = require('event-stream');
|
||||||
const File = require('vinyl');
|
const File = require('vinyl');
|
||||||
@@ -48,9 +49,6 @@ var editorResources = [
|
|||||||
'!**/test/**'
|
'!**/test/**'
|
||||||
];
|
];
|
||||||
|
|
||||||
var editorOtherSources = [
|
|
||||||
];
|
|
||||||
|
|
||||||
var BUNDLED_FILE_HEADER = [
|
var BUNDLED_FILE_HEADER = [
|
||||||
'/*!-----------------------------------------------------------',
|
'/*!-----------------------------------------------------------',
|
||||||
' * Copyright (c) Microsoft Corporation. All rights reserved.',
|
' * Copyright (c) Microsoft Corporation. All rights reserved.',
|
||||||
@@ -63,8 +61,7 @@ var BUNDLED_FILE_HEADER = [
|
|||||||
|
|
||||||
const languages = i18n.defaultLanguages.concat([]); // i18n.defaultLanguages.concat(process.env.VSCODE_QUALITY !== 'stable' ? i18n.extraLanguages : []);
|
const languages = i18n.defaultLanguages.concat([]); // i18n.defaultLanguages.concat(process.env.VSCODE_QUALITY !== 'stable' ? i18n.extraLanguages : []);
|
||||||
|
|
||||||
gulp.task('clean-editor-src', util.rimraf('out-editor-src'));
|
const extractEditorSrcTask = task.define('extract-editor-src', () => {
|
||||||
gulp.task('extract-editor-src', ['clean-editor-src'], function () {
|
|
||||||
console.log(`If the build fails, consider tweaking shakeLevel below to a lower value.`);
|
console.log(`If the build fails, consider tweaking shakeLevel below to a lower value.`);
|
||||||
const apiusages = monacoapi.execute().usageContent;
|
const apiusages = monacoapi.execute().usageContent;
|
||||||
const extrausages = fs.readFileSync(path.join(root, 'build', 'monaco', 'monaco.usage.recipe')).toString();
|
const extrausages = fs.readFileSync(path.join(root, 'build', 'monaco', 'monaco.usage.recipe')).toString();
|
||||||
@@ -84,6 +81,7 @@ gulp.task('extract-editor-src', ['clean-editor-src'], function () {
|
|||||||
'typings/thenable.d.ts',
|
'typings/thenable.d.ts',
|
||||||
'typings/es6-promise.d.ts',
|
'typings/es6-promise.d.ts',
|
||||||
'typings/require-monaco.d.ts',
|
'typings/require-monaco.d.ts',
|
||||||
|
"typings/lib.es2018.promise.d.ts",
|
||||||
'vs/monaco.d.ts'
|
'vs/monaco.d.ts'
|
||||||
],
|
],
|
||||||
libs: [
|
libs: [
|
||||||
@@ -100,15 +98,11 @@ gulp.task('extract-editor-src', ['clean-editor-src'], function () {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Full compile, including nls and inline sources in sourcemaps, for build
|
const compileEditorAMDTask = task.define('compile-editor-amd', compilation.compileTask('out-editor-src', 'out-editor-build', true));
|
||||||
gulp.task('clean-editor-build', util.rimraf('out-editor-build'));
|
|
||||||
gulp.task('compile-editor-build', ['clean-editor-build', 'extract-editor-src'], compilation.compileTask('out-editor-src', 'out-editor-build', true));
|
|
||||||
|
|
||||||
gulp.task('clean-optimized-editor', util.rimraf('out-editor'));
|
const optimizeEditorAMDTask = task.define('optimize-editor-amd', common.optimizeTask({
|
||||||
gulp.task('optimize-editor', ['clean-optimized-editor', 'compile-editor-build'], common.optimizeTask({
|
|
||||||
src: 'out-editor-build',
|
src: 'out-editor-build',
|
||||||
entryPoints: editorEntryPoints,
|
entryPoints: editorEntryPoints,
|
||||||
otherSources: editorOtherSources,
|
|
||||||
resources: editorResources,
|
resources: editorResources,
|
||||||
loaderConfig: {
|
loaderConfig: {
|
||||||
paths: {
|
paths: {
|
||||||
@@ -125,11 +119,9 @@ gulp.task('optimize-editor', ['clean-optimized-editor', 'compile-editor-build'],
|
|||||||
languages: languages
|
languages: languages
|
||||||
}));
|
}));
|
||||||
|
|
||||||
gulp.task('clean-minified-editor', util.rimraf('out-editor-min'));
|
const minifyEditorAMDTask = task.define('minify-editor-amd', common.minifyTask('out-editor'));
|
||||||
gulp.task('minify-editor', ['clean-minified-editor', 'optimize-editor'], common.minifyTask('out-editor'));
|
|
||||||
|
|
||||||
gulp.task('clean-editor-esm', util.rimraf('out-editor-esm'));
|
const createESMSourcesAndResourcesTask = task.define('extract-editor-esm', () => {
|
||||||
gulp.task('extract-editor-esm', ['clean-editor-esm', 'clean-editor-distro', 'extract-editor-src'], function () {
|
|
||||||
standalone.createESMSourcesAndResources2({
|
standalone.createESMSourcesAndResources2({
|
||||||
srcFolder: './out-editor-src',
|
srcFolder: './out-editor-src',
|
||||||
outFolder: './out-editor-esm',
|
outFolder: './out-editor-esm',
|
||||||
@@ -151,7 +143,8 @@ gulp.task('extract-editor-esm', ['clean-editor-esm', 'clean-editor-distro', 'ext
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
gulp.task('compile-editor-esm', ['extract-editor-esm', 'clean-editor-distro'], function () {
|
|
||||||
|
const compileEditorESMTask = task.define('compile-editor-esm', () => {
|
||||||
if (process.platform === 'win32') {
|
if (process.platform === 'win32') {
|
||||||
const result = cp.spawnSync(`..\\node_modules\\.bin\\tsc.cmd`, {
|
const result = cp.spawnSync(`..\\node_modules\\.bin\\tsc.cmd`, {
|
||||||
cwd: path.join(__dirname, '../out-editor-esm')
|
cwd: path.join(__dirname, '../out-editor-esm')
|
||||||
@@ -202,8 +195,16 @@ function toExternalDTS(contents) {
|
|||||||
return lines.join('\n');
|
return lines.join('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
gulp.task('clean-editor-distro', util.rimraf('out-monaco-editor-core'));
|
function filterStream(testFunc) {
|
||||||
gulp.task('editor-distro', ['clean-editor-distro', 'compile-editor-esm', 'minify-editor', 'optimize-editor'], function () {
|
return es.through(function (data) {
|
||||||
|
if (!testFunc(data.relative)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.emit('data', data);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const finalEditorResourcesTask = task.define('final-editor-resources', () => {
|
||||||
return es.merge(
|
return es.merge(
|
||||||
// other assets
|
// other assets
|
||||||
es.merge(
|
es.merge(
|
||||||
@@ -233,6 +234,14 @@ gulp.task('editor-distro', ['clean-editor-distro', 'compile-editor-esm', 'minify
|
|||||||
}))
|
}))
|
||||||
.pipe(gulp.dest('out-monaco-editor-core')),
|
.pipe(gulp.dest('out-monaco-editor-core')),
|
||||||
|
|
||||||
|
// version.txt
|
||||||
|
gulp.src('build/monaco/version.txt')
|
||||||
|
.pipe(es.through(function (data) {
|
||||||
|
data.contents = Buffer.from(`monaco-editor-core: https://github.com/Microsoft/vscode/tree/${sha1}`);
|
||||||
|
this.emit('data', data);
|
||||||
|
}))
|
||||||
|
.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) {
|
||||||
@@ -266,7 +275,7 @@ gulp.task('editor-distro', ['clean-editor-distro', 'compile-editor-esm', 'minify
|
|||||||
|
|
||||||
var strContents = data.contents.toString();
|
var strContents = data.contents.toString();
|
||||||
var newStr = '//# sourceMappingURL=' + relativePathToMap.replace(/\\/g, '/');
|
var newStr = '//# sourceMappingURL=' + relativePathToMap.replace(/\\/g, '/');
|
||||||
strContents = strContents.replace(/\/\/\# sourceMappingURL=[^ ]+$/, newStr);
|
strContents = strContents.replace(/\/\/# sourceMappingURL=[^ ]+$/, newStr);
|
||||||
|
|
||||||
data.contents = Buffer.from(strContents);
|
data.contents = Buffer.from(strContents);
|
||||||
this.emit('data', data);
|
this.emit('data', data);
|
||||||
@@ -282,59 +291,31 @@ gulp.task('editor-distro', ['clean-editor-distro', 'compile-editor-esm', 'minify
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('analyze-editor-distro', function () {
|
gulp.task('editor-distro',
|
||||||
// @ts-ignore
|
task.series(
|
||||||
var bundleInfo = require('../out-editor/bundleInfo.json');
|
task.parallel(
|
||||||
var graph = bundleInfo.graph;
|
util.rimraf('out-editor-src'),
|
||||||
var bundles = bundleInfo.bundles;
|
util.rimraf('out-editor-build'),
|
||||||
|
util.rimraf('out-editor-esm'),
|
||||||
var inverseGraph = {};
|
util.rimraf('out-monaco-editor-core'),
|
||||||
Object.keys(graph).forEach(function (module) {
|
util.rimraf('out-editor'),
|
||||||
var dependencies = graph[module];
|
util.rimraf('out-editor-min')
|
||||||
dependencies.forEach(function (dep) {
|
),
|
||||||
inverseGraph[dep] = inverseGraph[dep] || [];
|
extractEditorSrcTask,
|
||||||
inverseGraph[dep].push(module);
|
task.parallel(
|
||||||
});
|
task.series(
|
||||||
});
|
compileEditorAMDTask,
|
||||||
|
optimizeEditorAMDTask,
|
||||||
var detailed = {};
|
minifyEditorAMDTask
|
||||||
Object.keys(bundles).forEach(function (entryPoint) {
|
),
|
||||||
var included = bundles[entryPoint];
|
task.series(
|
||||||
var includedMap = {};
|
createESMSourcesAndResourcesTask,
|
||||||
included.forEach(function (included) {
|
compileEditorESMTask
|
||||||
includedMap[included] = true;
|
)
|
||||||
});
|
),
|
||||||
|
finalEditorResourcesTask
|
||||||
var explanation = [];
|
)
|
||||||
included.map(function (included) {
|
);
|
||||||
if (included.indexOf('!') >= 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var reason = (inverseGraph[included] || []).filter(function (mod) {
|
|
||||||
return !!includedMap[mod];
|
|
||||||
});
|
|
||||||
explanation.push({
|
|
||||||
module: included,
|
|
||||||
reason: reason
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
detailed[entryPoint] = explanation;
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(JSON.stringify(detailed, null, '\t'));
|
|
||||||
});
|
|
||||||
|
|
||||||
function filterStream(testFunc) {
|
|
||||||
return es.through(function (data) {
|
|
||||||
if (!testFunc(data.relative)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.emit('data', data);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//#region monaco type checking
|
//#region monaco type checking
|
||||||
|
|
||||||
@@ -354,6 +335,7 @@ function createTscCompileTask(watch) {
|
|||||||
let errors = [];
|
let errors = [];
|
||||||
let reporter = createReporter();
|
let reporter = createReporter();
|
||||||
let report;
|
let report;
|
||||||
|
// eslint-disable-next-line no-control-regex
|
||||||
let magic = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g; // https://stackoverflow.com/questions/25245716/remove-all-ansi-colors-styles-from-strings
|
let magic = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g; // https://stackoverflow.com/questions/25245716/remove-all-ansi-colors-styles-from-strings
|
||||||
|
|
||||||
child.stdout.on('data', data => {
|
child.stdout.on('data', data => {
|
||||||
@@ -387,7 +369,10 @@ function createTscCompileTask(watch) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
gulp.task('monaco-typecheck-watch', createTscCompileTask(true));
|
const monacoTypecheckWatchTask = task.define('monaco-typecheck-watch', createTscCompileTask(true));
|
||||||
gulp.task('monaco-typecheck', createTscCompileTask(false));
|
exports.monacoTypecheckWatchTask = monacoTypecheckWatchTask;
|
||||||
|
|
||||||
|
const monacoTypecheckTask = task.define('monaco-typecheck', createTscCompileTask(false));
|
||||||
|
exports.monacoTypecheckTask = monacoTypecheckTask;
|
||||||
|
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ const path = require('path');
|
|||||||
const tsb = require('gulp-tsb');
|
const tsb = require('gulp-tsb');
|
||||||
const es = require('event-stream');
|
const es = require('event-stream');
|
||||||
const filter = require('gulp-filter');
|
const filter = require('gulp-filter');
|
||||||
const rimraf = require('rimraf');
|
|
||||||
const util = require('./lib/util');
|
const util = require('./lib/util');
|
||||||
|
const task = require('./lib/task');
|
||||||
const watcher = require('./lib/watch');
|
const watcher = require('./lib/watch');
|
||||||
const createReporter = require('./lib/reporter').createReporter;
|
const createReporter = require('./lib/reporter').createReporter;
|
||||||
const glob = require('glob');
|
const glob = require('glob');
|
||||||
@@ -43,16 +43,6 @@ const tasks = compilations.map(function (tsconfigFile) {
|
|||||||
|
|
||||||
const name = relativeDirname.replace(/\//g, '-');
|
const name = relativeDirname.replace(/\//g, '-');
|
||||||
|
|
||||||
// Tasks
|
|
||||||
const clean = 'clean-extension:' + name;
|
|
||||||
const compile = 'compile-extension:' + name;
|
|
||||||
const watch = 'watch-extension:' + name;
|
|
||||||
|
|
||||||
// Build Tasks
|
|
||||||
const cleanBuild = 'clean-extension-build:' + name;
|
|
||||||
const compileBuild = 'compile-extension-build:' + name;
|
|
||||||
const watchBuild = 'watch-extension-build:' + name;
|
|
||||||
|
|
||||||
const root = path.join('extensions', relativeDirname);
|
const root = path.join('extensions', relativeDirname);
|
||||||
const srcBase = path.join(root, 'src');
|
const srcBase = path.join(root, 'src');
|
||||||
const src = path.join(srcBase, '**');
|
const src = path.join(srcBase, '**');
|
||||||
@@ -111,18 +101,18 @@ const tasks = compilations.map(function (tsconfigFile) {
|
|||||||
|
|
||||||
const srcOpts = { cwd: path.dirname(__dirname), base: srcBase };
|
const srcOpts = { cwd: path.dirname(__dirname), base: srcBase };
|
||||||
|
|
||||||
gulp.task(clean, cb => rimraf(out, cb));
|
const cleanTask = task.define(`clean-extension-${name}`, util.rimraf(out));
|
||||||
|
|
||||||
gulp.task(compile, [clean], () => {
|
const compileTask = task.define(`compile-extension:${name}`, task.series(cleanTask, () => {
|
||||||
const pipeline = createPipeline(false, true);
|
const pipeline = createPipeline(false, true);
|
||||||
const input = gulp.src(src, srcOpts);
|
const input = gulp.src(src, srcOpts);
|
||||||
|
|
||||||
return input
|
return input
|
||||||
.pipe(pipeline())
|
.pipe(pipeline())
|
||||||
.pipe(gulp.dest(out));
|
.pipe(gulp.dest(out));
|
||||||
});
|
}));
|
||||||
|
|
||||||
gulp.task(watch, [clean], () => {
|
const watchTask = task.define(`watch-extension:${name}`, task.series(cleanTask, () => {
|
||||||
const pipeline = createPipeline(false);
|
const pipeline = createPipeline(false);
|
||||||
const input = gulp.src(src, srcOpts);
|
const input = gulp.src(src, srcOpts);
|
||||||
const watchInput = watcher(src, srcOpts);
|
const watchInput = watcher(src, srcOpts);
|
||||||
@@ -130,43 +120,35 @@ const tasks = compilations.map(function (tsconfigFile) {
|
|||||||
return watchInput
|
return watchInput
|
||||||
.pipe(util.incremental(pipeline, input))
|
.pipe(util.incremental(pipeline, input))
|
||||||
.pipe(gulp.dest(out));
|
.pipe(gulp.dest(out));
|
||||||
});
|
}));
|
||||||
|
|
||||||
gulp.task(cleanBuild, cb => rimraf(out, cb));
|
const compileBuildTask = task.define(`compile-build-extension-${name}`, task.series(cleanTask, () => {
|
||||||
|
|
||||||
gulp.task(compileBuild, [clean], () => {
|
|
||||||
const pipeline = createPipeline(true, true);
|
const pipeline = createPipeline(true, true);
|
||||||
const input = gulp.src(src, srcOpts);
|
const input = gulp.src(src, srcOpts);
|
||||||
|
|
||||||
return input
|
return input
|
||||||
.pipe(pipeline())
|
.pipe(pipeline())
|
||||||
.pipe(gulp.dest(out));
|
.pipe(gulp.dest(out));
|
||||||
});
|
}));
|
||||||
|
|
||||||
gulp.task(watchBuild, [clean], () => {
|
// Tasks
|
||||||
const pipeline = createPipeline(true);
|
gulp.task(compileTask);
|
||||||
const input = gulp.src(src, srcOpts);
|
gulp.task(watchTask);
|
||||||
const watchInput = watcher(src, srcOpts);
|
|
||||||
|
|
||||||
return watchInput
|
|
||||||
.pipe(util.incremental(() => pipeline(), input))
|
|
||||||
.pipe(gulp.dest(out));
|
|
||||||
});
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
clean: clean,
|
compileTask: compileTask,
|
||||||
compile: compile,
|
watchTask: watchTask,
|
||||||
watch: watch,
|
compileBuildTask: compileBuildTask
|
||||||
cleanBuild: cleanBuild,
|
|
||||||
compileBuild: compileBuild,
|
|
||||||
watchBuild: watchBuild
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('clean-extensions', tasks.map(t => t.clean));
|
const compileExtensionsTask = task.define('compile-extensions', task.parallel(...tasks.map(t => t.compileTask)));
|
||||||
gulp.task('compile-extensions', tasks.map(t => t.compile));
|
gulp.task(compileExtensionsTask);
|
||||||
gulp.task('watch-extensions', tasks.map(t => t.watch));
|
exports.compileExtensionsTask = compileExtensionsTask;
|
||||||
|
|
||||||
gulp.task('clean-extensions-build', tasks.map(t => t.cleanBuild));
|
const watchExtensionsTask = task.define('watch-extensions', task.parallel(...tasks.map(t => t.watchTask)));
|
||||||
gulp.task('compile-extensions-build', tasks.map(t => t.compileBuild));
|
gulp.task(watchExtensionsTask);
|
||||||
gulp.task('watch-extensions-build', tasks.map(t => t.watchBuild));
|
exports.watchExtensionsTask = watchExtensionsTask;
|
||||||
|
|
||||||
|
const compileExtensionsBuildTask = task.define('compile-extensions-build', task.parallel(...tasks.map(t => t.compileBuildTask)));
|
||||||
|
exports.compileExtensionsBuildTask = compileExtensionsBuildTask;
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ const indentationFilter = [
|
|||||||
'!src/typings/**/*.d.ts',
|
'!src/typings/**/*.d.ts',
|
||||||
'!extensions/**/*.d.ts',
|
'!extensions/**/*.d.ts',
|
||||||
'!**/*.{svg,exe,png,bmp,scpt,bat,cmd,cur,ttf,woff,eot,md,ps1,template,yaml,yml,d.ts.recipe,ico,icns}',
|
'!**/*.{svg,exe,png,bmp,scpt,bat,cmd,cur,ttf,woff,eot,md,ps1,template,yaml,yml,d.ts.recipe,ico,icns}',
|
||||||
'!build/{lib,tslintRules}/**/*.js',
|
'!build/{lib,tslintRules,download}/**/*.js',
|
||||||
'!build/**/*.sh',
|
'!build/**/*.sh',
|
||||||
'!build/azure-pipelines/**/*.js',
|
'!build/azure-pipelines/**/*.js',
|
||||||
'!build/azure-pipelines/**/*.config',
|
'!build/azure-pipelines/**/*.config',
|
||||||
@@ -230,7 +230,7 @@ function hygiene(some) {
|
|||||||
let formatted = result.dest.replace(/\r\n/gm, '\n');
|
let formatted = result.dest.replace(/\r\n/gm, '\n');
|
||||||
|
|
||||||
if (original !== formatted) {
|
if (original !== formatted) {
|
||||||
console.error('File not formatted:', file.relative);
|
console.error("File not formatted. Run the 'Format Document' command to fix it:", file.relative);
|
||||||
errorCount++;
|
errorCount++;
|
||||||
}
|
}
|
||||||
cb(null, file);
|
cb(null, file);
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ const filter = require('gulp-filter');
|
|||||||
const json = require('gulp-json-editor');
|
const json = require('gulp-json-editor');
|
||||||
const _ = require('underscore');
|
const _ = require('underscore');
|
||||||
const util = require('./lib/util');
|
const util = require('./lib/util');
|
||||||
|
const task = require('./lib/task');
|
||||||
const ext = require('./lib/extensions');
|
const ext = require('./lib/extensions');
|
||||||
const buildfile = require('../src/buildfile');
|
const buildfile = require('../src/buildfile');
|
||||||
const common = require('./lib/optimize');
|
const common = require('./lib/optimize');
|
||||||
@@ -38,6 +39,7 @@ const deps = require('./dependencies');
|
|||||||
const getElectronVersion = require('./lib/electron').getElectronVersion;
|
const getElectronVersion = require('./lib/electron').getElectronVersion;
|
||||||
const createAsar = require('./lib/asar').createAsar;
|
const createAsar = require('./lib/asar').createAsar;
|
||||||
const minimist = require('minimist');
|
const minimist = require('minimist');
|
||||||
|
const { compileBuildTask } = require('./gulpfile.compile');
|
||||||
|
|
||||||
const productionDependencies = deps.getProductionDependencies(path.dirname(__dirname));
|
const productionDependencies = deps.getProductionDependencies(path.dirname(__dirname));
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@@ -76,15 +78,16 @@ const vscodeResources = [
|
|||||||
'out-build/paths.js',
|
'out-build/paths.js',
|
||||||
'out-build/vs/**/*.{svg,png,cur,html}',
|
'out-build/vs/**/*.{svg,png,cur,html}',
|
||||||
'out-build/vs/base/common/performance.js',
|
'out-build/vs/base/common/performance.js',
|
||||||
|
'out-build/vs/base/node/languagePacks.js',
|
||||||
'out-build/vs/base/node/{stdForkStart.js,terminateProcess.sh,cpuUsage.sh}',
|
'out-build/vs/base/node/{stdForkStart.js,terminateProcess.sh,cpuUsage.sh}',
|
||||||
'out-build/vs/base/browser/ui/octiconLabel/octicons/**',
|
'out-build/vs/base/browser/ui/octiconLabel/octicons/**',
|
||||||
'out-build/vs/workbench/browser/media/*-theme.css',
|
'out-build/vs/workbench/browser/media/*-theme.css',
|
||||||
'out-build/vs/workbench/parts/debug/**/*.json',
|
'out-build/vs/workbench/contrib/debug/**/*.json',
|
||||||
'out-build/vs/workbench/parts/execution/**/*.scpt',
|
'out-build/vs/workbench/contrib/externalTerminal/**/*.scpt',
|
||||||
'out-build/vs/workbench/parts/webview/electron-browser/webview-pre.js',
|
'out-build/vs/workbench/contrib/webview/electron-browser/webview-pre.js',
|
||||||
'out-build/vs/**/markdown.css',
|
'out-build/vs/**/markdown.css',
|
||||||
'out-build/vs/workbench/parts/tasks/**/*.json',
|
'out-build/vs/workbench/contrib/tasks/**/*.json',
|
||||||
'out-build/vs/workbench/parts/welcome/walkThrough/**/*.md',
|
'out-build/vs/workbench/contrib/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/workbench/**',
|
'out-build/vs/code/electron-browser/workbench/**',
|
||||||
@@ -121,29 +124,41 @@ const BUNDLED_FILE_HEADER = [
|
|||||||
' *--------------------------------------------------------*/'
|
' *--------------------------------------------------------*/'
|
||||||
].join('\n');
|
].join('\n');
|
||||||
|
|
||||||
gulp.task('clean-optimized-vscode', util.rimraf('out-vscode'));
|
const optimizeVSCodeTask = task.define('optimize-vscode', task.series(
|
||||||
gulp.task('optimize-vscode', ['clean-optimized-vscode', 'compile-build', 'compile-extensions-build'], common.optimizeTask({
|
task.parallel(
|
||||||
|
util.rimraf('out-vscode'),
|
||||||
|
compileBuildTask
|
||||||
|
),
|
||||||
|
common.optimizeTask({
|
||||||
src: 'out-build',
|
src: 'out-build',
|
||||||
entryPoints: vscodeEntryPoints,
|
entryPoints: vscodeEntryPoints,
|
||||||
otherSources: [],
|
|
||||||
resources: vscodeResources,
|
resources: vscodeResources,
|
||||||
loaderConfig: common.loaderConfig(nodeModules),
|
loaderConfig: common.loaderConfig(nodeModules),
|
||||||
header: BUNDLED_FILE_HEADER,
|
header: BUNDLED_FILE_HEADER,
|
||||||
out: 'out-vscode',
|
out: 'out-vscode',
|
||||||
bundleInfo: undefined
|
bundleInfo: undefined
|
||||||
}));
|
})
|
||||||
|
));
|
||||||
|
|
||||||
|
|
||||||
gulp.task('optimize-index-js', ['optimize-vscode'], () => {
|
const optimizeIndexJSTask = task.define('optimize-index-js', task.series(
|
||||||
|
optimizeVSCodeTask,
|
||||||
|
() => {
|
||||||
const fullpath = path.join(process.cwd(), 'out-vscode/bootstrap-window.js');
|
const fullpath = path.join(process.cwd(), 'out-vscode/bootstrap-window.js');
|
||||||
const contents = fs.readFileSync(fullpath).toString();
|
const contents = fs.readFileSync(fullpath).toString();
|
||||||
const newContents = contents.replace('[/*BUILD->INSERT_NODE_MODULES*/]', JSON.stringify(nodeModules));
|
const newContents = contents.replace('[/*BUILD->INSERT_NODE_MODULES*/]', JSON.stringify(nodeModules));
|
||||||
fs.writeFileSync(fullpath, newContents);
|
fs.writeFileSync(fullpath, newContents);
|
||||||
});
|
}
|
||||||
|
));
|
||||||
|
|
||||||
const sourceMappingURLBase = `https://ticino.blob.core.windows.net/sourcemaps/${commit}`;
|
const sourceMappingURLBase = `https://ticino.blob.core.windows.net/sourcemaps/${commit}`;
|
||||||
gulp.task('clean-minified-vscode', util.rimraf('out-vscode-min'));
|
const minifyVSCodeTask = task.define('minify-vscode', task.series(
|
||||||
gulp.task('minify-vscode', ['clean-minified-vscode', 'optimize-index-js'], common.minifyTask('out-vscode', `${sourceMappingURLBase}/core`));
|
task.parallel(
|
||||||
|
util.rimraf('out-vscode-min'),
|
||||||
|
optimizeIndexJSTask
|
||||||
|
),
|
||||||
|
common.minifyTask('out-vscode', `${sourceMappingURLBase}/core`)
|
||||||
|
));
|
||||||
|
|
||||||
// Package
|
// Package
|
||||||
|
|
||||||
@@ -206,13 +221,11 @@ function getElectron(arch) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
gulp.task('clean-electron', util.rimraf('.build/electron'));
|
gulp.task(task.define('electron', task.series(util.rimraf('.build/electron'), getElectron(process.arch))));
|
||||||
gulp.task('electron', ['clean-electron'], getElectron(process.arch));
|
gulp.task(task.define('electron-ia32', task.series(util.rimraf('.build/electron'), getElectron('ia32'))));
|
||||||
gulp.task('electron-ia32', ['clean-electron'], getElectron('ia32'));
|
gulp.task(task.define('electron-x64', task.series(util.rimraf('.build/electron'), getElectron('x64'))));
|
||||||
gulp.task('electron-x64', ['clean-electron'], getElectron('x64'));
|
gulp.task(task.define('electron-arm', task.series(util.rimraf('.build/electron'), getElectron('armv7l'))));
|
||||||
gulp.task('electron-arm', ['clean-electron'], getElectron('arm'));
|
gulp.task(task.define('electron-arm64', task.series(util.rimraf('.build/electron'), getElectron('arm64'))));
|
||||||
gulp.task('electron-arm64', ['clean-electron'], getElectron('arm64'));
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compute checksums for some files.
|
* Compute checksums for some files.
|
||||||
@@ -248,15 +261,14 @@ function computeChecksum(filename) {
|
|||||||
return hash;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
function packageTask(platform, arch, opts) {
|
function packageTask(platform, arch, sourceFolderName, destinationFolderName, opts) {
|
||||||
opts = opts || {};
|
opts = opts || {};
|
||||||
|
|
||||||
// {{SQL CARBON EDIT}}
|
const destination = path.join(path.dirname(root), destinationFolderName);
|
||||||
const destination = path.join(path.dirname(root), 'azuredatastudio') + (platform ? '-' + platform : '') + (arch ? '-' + arch : '');
|
|
||||||
platform = platform || process.platform;
|
platform = platform || process.platform;
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
const out = opts.minified ? 'out-vscode-min' : 'out-vscode';
|
const out = sourceFolderName;
|
||||||
|
|
||||||
const checksums = computeChecksums(out, [
|
const checksums = computeChecksums(out, [
|
||||||
'vs/workbench/workbench.main.js',
|
'vs/workbench/workbench.main.js',
|
||||||
@@ -309,14 +321,13 @@ function packageTask(platform, arch, opts) {
|
|||||||
const productJsonStream = gulp.src(['product.json'], { base: '.' })
|
const productJsonStream = gulp.src(['product.json'], { base: '.' })
|
||||||
.pipe(json(productJsonUpdate));
|
.pipe(json(productJsonUpdate));
|
||||||
|
|
||||||
const license = gulp.src(['LICENSES.chromium.html', 'LICENSE.txt', 'ThirdPartyNotices.txt', 'licenses/**'], { base: '.' });
|
const license = gulp.src(['LICENSES.chromium.html', 'LICENSE.txt', 'ThirdPartyNotices.txt', 'licenses/**'], { base: '.', allowEmpty: true });
|
||||||
|
|
||||||
const watermark = gulp.src(['resources/letterpress.svg', 'resources/letterpress-dark.svg', 'resources/letterpress-hc.svg'], { base: '.' });
|
|
||||||
|
|
||||||
// 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/sql/azdata.d.ts').pipe(rename('out/sql/azdata.d.ts'));
|
||||||
|
const sqlopsAPI = gulp.src('src/sql/sqlops.d.ts').pipe(rename('out/sql/sqlops.d.ts'));
|
||||||
|
|
||||||
const depsSrc = [
|
const depsSrc = [
|
||||||
..._.flatten(productionDependencies.map(d => path.relative(root, d.path)).map(d => [`${d}/**`, `!${d}/**/{test,tests}/**`])),
|
..._.flatten(productionDependencies.map(d => path.relative(root, d.path)).map(d => [`${d}/**`, `!${d}/**/{test,tests}/**`])),
|
||||||
@@ -351,6 +362,8 @@ function packageTask(platform, arch, opts) {
|
|||||||
.pipe(util.cleanNodeModule('vscode-nsfw', ['binding.gyp', 'build/**', 'src/**', 'openpa/**', 'includes/**'], ['**/*.node', '**/*.a']))
|
.pipe(util.cleanNodeModule('vscode-nsfw', ['binding.gyp', 'build/**', 'src/**', 'openpa/**', 'includes/**'], ['**/*.node', '**/*.a']))
|
||||||
// {{SQL CARBON EDIT}} - End
|
// {{SQL CARBON EDIT}} - End
|
||||||
.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(util.cleanNodeModule('win-ca-lib', ['**/*'], ['package.json', '**/*.node']))
|
||||||
|
.pipe(util.cleanNodeModule('node-addon-api', ['**/*']))
|
||||||
.pipe(createAsar(path.join(process.cwd(), 'node_modules'), ['**/*.node', '**/vscode-ripgrep/bin/*', '**/node-pty/build/Release/*'], 'app/node_modules.asar'));
|
.pipe(createAsar(path.join(process.cwd(), 'node_modules'), ['**/*.node', '**/vscode-ripgrep/bin/*', '**/node-pty/build/Release/*'], 'app/node_modules.asar'));
|
||||||
|
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
@@ -361,50 +374,29 @@ function packageTask(platform, arch, opts) {
|
|||||||
'node_modules/underscore/**/*.*',
|
'node_modules/underscore/**/*.*',
|
||||||
'node_modules/zone.js/**/*.*',
|
'node_modules/zone.js/**/*.*',
|
||||||
'node_modules/chart.js/**/*.*',
|
'node_modules/chart.js/**/*.*',
|
||||||
|
'node_modules/chartjs-color/**/*.*',
|
||||||
|
'node_modules/chartjs-color-string/**/*.*',
|
||||||
|
'node_modules/color-convert/**/*.*',
|
||||||
|
'node_modules/color-name/**/*.*',
|
||||||
|
'node_modules/moment/**/*.*'
|
||||||
], { base: '.', dot: true });
|
], { base: '.', dot: true });
|
||||||
|
|
||||||
let all = es.merge(
|
let all = es.merge(
|
||||||
packageJsonStream,
|
packageJsonStream,
|
||||||
productJsonStream,
|
productJsonStream,
|
||||||
license,
|
license,
|
||||||
watermark,
|
|
||||||
api,
|
api,
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
copiedModules,
|
copiedModules,
|
||||||
dataApi,
|
dataApi,
|
||||||
|
sqlopsAPI,
|
||||||
sources,
|
sources,
|
||||||
deps
|
deps
|
||||||
);
|
);
|
||||||
|
|
||||||
if (platform === 'win32') {
|
if (platform === 'win32') {
|
||||||
all = es.merge(all, gulp.src([
|
all = es.merge(all, gulp.src([
|
||||||
'resources/win32/bower.ico',
|
// {{SQL CARBON EDIT}} remove unused icons
|
||||||
'resources/win32/c.ico',
|
|
||||||
'resources/win32/config.ico',
|
|
||||||
'resources/win32/cpp.ico',
|
|
||||||
'resources/win32/csharp.ico',
|
|
||||||
'resources/win32/css.ico',
|
|
||||||
'resources/win32/default.ico',
|
|
||||||
'resources/win32/go.ico',
|
|
||||||
'resources/win32/html.ico',
|
|
||||||
'resources/win32/jade.ico',
|
|
||||||
'resources/win32/java.ico',
|
|
||||||
'resources/win32/javascript.ico',
|
|
||||||
'resources/win32/json.ico',
|
|
||||||
'resources/win32/less.ico',
|
|
||||||
'resources/win32/markdown.ico',
|
|
||||||
'resources/win32/php.ico',
|
|
||||||
'resources/win32/powershell.ico',
|
|
||||||
'resources/win32/python.ico',
|
|
||||||
'resources/win32/react.ico',
|
|
||||||
'resources/win32/ruby.ico',
|
|
||||||
'resources/win32/sass.ico',
|
|
||||||
'resources/win32/shell.ico',
|
|
||||||
'resources/win32/sql.ico',
|
|
||||||
'resources/win32/typescript.ico',
|
|
||||||
'resources/win32/vue.ico',
|
|
||||||
'resources/win32/xml.ico',
|
|
||||||
'resources/win32/yaml.ico',
|
|
||||||
'resources/win32/code_70x70.png',
|
'resources/win32/code_70x70.png',
|
||||||
'resources/win32/code_150x150.png'
|
'resources/win32/code_150x150.png'
|
||||||
], { base: '.' }));
|
], { base: '.' }));
|
||||||
@@ -426,7 +418,7 @@ function packageTask(platform, arch, opts) {
|
|||||||
// result = es.merge(result, gulp.src('resources/completions/**', { base: '.' }));
|
// result = es.merge(result, gulp.src('resources/completions/**', { base: '.' }));
|
||||||
|
|
||||||
if (platform === 'win32') {
|
if (platform === 'win32') {
|
||||||
result = es.merge(result, gulp.src('resources/win32/bin/code.js', { base: 'resources/win32' }));
|
result = es.merge(result, gulp.src('resources/win32/bin/code.js', { base: 'resources/win32', allowEmpty: true }));
|
||||||
|
|
||||||
result = es.merge(result, gulp.src('resources/win32/bin/code.cmd', { base: 'resources/win32' })
|
result = es.merge(result, gulp.src('resources/win32/bin/code.cmd', { base: 'resources/win32' })
|
||||||
.pipe(replace('@@NAME@@', product.nameShort))
|
.pipe(replace('@@NAME@@', product.nameShort))
|
||||||
@@ -461,38 +453,37 @@ function packageTask(platform, arch, opts) {
|
|||||||
|
|
||||||
const buildRoot = path.dirname(root);
|
const buildRoot = path.dirname(root);
|
||||||
|
|
||||||
// {{SQL CARBON EDIT}}
|
const BUILD_TARGETS = [
|
||||||
gulp.task('vscode-win32-x64-azurecore', ['optimize-vscode'], ext.packageExtensionTask('azurecore', 'win32', 'x64'));
|
{ platform: 'win32', arch: 'ia32' },
|
||||||
gulp.task('vscode-darwin-azurecore', ['optimize-vscode'], ext.packageExtensionTask('azurecore', 'darwin'));
|
{ platform: 'win32', arch: 'x64' },
|
||||||
gulp.task('vscode-linux-x64-azurecore', ['optimize-vscode'], ext.packageExtensionTask('azurecore', 'linux', 'x64'));
|
{ platform: 'darwin', arch: null, opts: { stats: true } },
|
||||||
|
{ platform: 'linux', arch: 'ia32' },
|
||||||
|
{ platform: 'linux', arch: 'x64' },
|
||||||
|
{ platform: 'linux', arch: 'arm' },
|
||||||
|
{ platform: 'linux', arch: 'arm64' },
|
||||||
|
];
|
||||||
|
BUILD_TARGETS.forEach(buildTarget => {
|
||||||
|
const dashed = (str) => (str ? `-${str}` : ``);
|
||||||
|
const platform = buildTarget.platform;
|
||||||
|
const arch = buildTarget.arch;
|
||||||
|
const opts = buildTarget.opts;
|
||||||
|
|
||||||
gulp.task('vscode-win32-x64-mssql', ['vscode-linux-x64-azurecore', 'optimize-vscode'], ext.packageExtensionTask('mssql', 'win32', 'x64'));
|
['', 'min'].forEach(minified => {
|
||||||
gulp.task('vscode-darwin-mssql', ['vscode-linux-x64-azurecore', 'optimize-vscode'], ext.packageExtensionTask('mssql', 'darwin'));
|
const sourceFolderName = `out-vscode${dashed(minified)}`;
|
||||||
gulp.task('vscode-linux-x64-mssql', ['vscode-linux-x64-azurecore', 'optimize-vscode'], ext.packageExtensionTask('mssql', 'linux', 'x64'));
|
const destinationFolderName = `azuredatastudio${dashed(platform)}${dashed(arch)}`;
|
||||||
|
|
||||||
gulp.task('clean-vscode-win32-ia32', util.rimraf(path.join(buildRoot, 'azuredatastudio-win32-ia32')));
|
const vscodeTask = task.define(`vscode${dashed(platform)}${dashed(arch)}${dashed(minified)}`, task.series(
|
||||||
gulp.task('clean-vscode-win32-x64', util.rimraf(path.join(buildRoot, 'azuredatastudio-win32-x64')));
|
task.parallel(
|
||||||
gulp.task('clean-vscode-darwin', util.rimraf(path.join(buildRoot, 'azuredatastudio-darwin')));
|
minified ? minifyVSCodeTask : optimizeVSCodeTask,
|
||||||
gulp.task('clean-vscode-linux-ia32', util.rimraf(path.join(buildRoot, 'azuredatastudio-linux-ia32')));
|
util.rimraf(path.join(buildRoot, destinationFolderName))
|
||||||
gulp.task('clean-vscode-linux-x64', util.rimraf(path.join(buildRoot, 'azuredatastudio-linux-x64')));
|
),
|
||||||
gulp.task('clean-vscode-linux-arm', util.rimraf(path.join(buildRoot, 'azuredatastudio-linux-arm')));
|
ext.packageExtensionTask('mssql', platform, arch),
|
||||||
gulp.task('clean-vscode-linux-arm64', util.rimraf(path.join(buildRoot, 'azuredatastudio-linux-arm64')));
|
ext.packageExtensionTask('azurecore', platform, arch),
|
||||||
|
packageTask(platform, arch, sourceFolderName, destinationFolderName, opts)
|
||||||
gulp.task('vscode-win32-ia32', ['optimize-vscode', 'clean-vscode-win32-ia32'], packageTask('win32', 'ia32'));
|
));
|
||||||
gulp.task('vscode-win32-x64', ['vscode-win32-x64-azurecore', 'vscode-win32-x64-mssql', 'optimize-vscode', 'clean-vscode-win32-x64'], packageTask('win32', 'x64'));
|
gulp.task(vscodeTask);
|
||||||
gulp.task('vscode-darwin', ['vscode-darwin-azurecore', 'vscode-darwin-mssql', 'optimize-vscode', 'clean-vscode-darwin'], packageTask('darwin', null, { stats: true }));
|
});
|
||||||
gulp.task('vscode-linux-ia32', ['optimize-vscode', 'clean-vscode-linux-ia32'], packageTask('linux', 'ia32'));
|
});
|
||||||
gulp.task('vscode-linux-x64', ['vscode-linux-x64-azurecore', 'vscode-linux-x64-mssql', 'optimize-vscode', 'clean-vscode-linux-x64'], packageTask('linux', 'x64'));
|
|
||||||
gulp.task('vscode-linux-arm', ['optimize-vscode', 'clean-vscode-linux-arm'], packageTask('linux', 'arm'));
|
|
||||||
gulp.task('vscode-linux-arm64', ['optimize-vscode', 'clean-vscode-linux-arm64'], packageTask('linux', 'arm64'));
|
|
||||||
|
|
||||||
gulp.task('vscode-win32-ia32-min', ['minify-vscode', 'clean-vscode-win32-ia32'], packageTask('win32', 'ia32', { minified: true }));
|
|
||||||
gulp.task('vscode-win32-x64-min', ['minify-vscode', 'clean-vscode-win32-x64'], packageTask('win32', 'x64', { minified: true }));
|
|
||||||
gulp.task('vscode-darwin-min', ['minify-vscode', 'clean-vscode-darwin'], packageTask('darwin', null, { minified: true, stats: true }));
|
|
||||||
gulp.task('vscode-linux-ia32-min', ['minify-vscode', 'clean-vscode-linux-ia32'], packageTask('linux', 'ia32', { minified: true }));
|
|
||||||
gulp.task('vscode-linux-x64-min', ['minify-vscode', 'clean-vscode-linux-x64'], packageTask('linux', 'x64', { minified: true }));
|
|
||||||
gulp.task('vscode-linux-arm-min', ['minify-vscode', 'clean-vscode-linux-arm'], packageTask('linux', 'arm', { minified: true }));
|
|
||||||
gulp.task('vscode-linux-arm64-min', ['minify-vscode', 'clean-vscode-linux-arm64'], packageTask('linux', 'arm64', { minified: true }));
|
|
||||||
|
|
||||||
// Transifex Localizations
|
// Transifex Localizations
|
||||||
|
|
||||||
@@ -515,7 +506,11 @@ const apiHostname = process.env.TRANSIFEX_API_URL;
|
|||||||
const apiName = process.env.TRANSIFEX_API_NAME;
|
const apiName = process.env.TRANSIFEX_API_NAME;
|
||||||
const apiToken = process.env.TRANSIFEX_API_TOKEN;
|
const apiToken = process.env.TRANSIFEX_API_TOKEN;
|
||||||
|
|
||||||
gulp.task('vscode-translations-push', ['optimize-vscode'], function () {
|
gulp.task(task.define(
|
||||||
|
'vscode-translations-push',
|
||||||
|
task.series(
|
||||||
|
optimizeVSCodeTask,
|
||||||
|
function () {
|
||||||
const pathToMetadata = './out-vscode/nls.metadata.json';
|
const pathToMetadata = './out-vscode/nls.metadata.json';
|
||||||
const pathToExtensions = './extensions/*';
|
const pathToExtensions = './extensions/*';
|
||||||
const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}';
|
const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}';
|
||||||
@@ -526,9 +521,15 @@ gulp.task('vscode-translations-push', ['optimize-vscode'], function () {
|
|||||||
gulp.src(pathToExtensions).pipe(i18n.createXlfFilesForExtensions())
|
gulp.src(pathToExtensions).pipe(i18n.createXlfFilesForExtensions())
|
||||||
).pipe(i18n.findObsoleteResources(apiHostname, apiName, apiToken)
|
).pipe(i18n.findObsoleteResources(apiHostname, apiName, apiToken)
|
||||||
).pipe(i18n.pushXlfFiles(apiHostname, apiName, apiToken));
|
).pipe(i18n.pushXlfFiles(apiHostname, apiName, apiToken));
|
||||||
});
|
}
|
||||||
|
)
|
||||||
|
));
|
||||||
|
|
||||||
gulp.task('vscode-translations-export', ['optimize-vscode'], function () {
|
gulp.task(task.define(
|
||||||
|
'vscode-translations-export',
|
||||||
|
task.series(
|
||||||
|
optimizeVSCodeTask,
|
||||||
|
function () {
|
||||||
const pathToMetadata = './out-vscode/nls.metadata.json';
|
const pathToMetadata = './out-vscode/nls.metadata.json';
|
||||||
const pathToExtensions = './extensions/*';
|
const pathToExtensions = './extensions/*';
|
||||||
const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}';
|
const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}';
|
||||||
@@ -538,7 +539,9 @@ gulp.task('vscode-translations-export', ['optimize-vscode'], function () {
|
|||||||
gulp.src(pathToSetup).pipe(i18n.createXlfFilesForIsl()),
|
gulp.src(pathToSetup).pipe(i18n.createXlfFilesForIsl()),
|
||||||
gulp.src(pathToExtensions).pipe(i18n.createXlfFilesForExtensions())
|
gulp.src(pathToExtensions).pipe(i18n.createXlfFilesForExtensions())
|
||||||
).pipe(vfs.dest('../vscode-translations-export'));
|
).pipe(vfs.dest('../vscode-translations-export'));
|
||||||
});
|
}
|
||||||
|
)
|
||||||
|
));
|
||||||
|
|
||||||
gulp.task('vscode-translations-pull', function () {
|
gulp.task('vscode-translations-pull', function () {
|
||||||
return es.merge([...i18n.defaultLanguages, ...i18n.extraLanguages].map(language => {
|
return es.merge([...i18n.defaultLanguages, ...i18n.extraLanguages].map(language => {
|
||||||
@@ -559,7 +562,7 @@ gulp.task('vscode-translations-import', function () {
|
|||||||
|
|
||||||
// Sourcemaps
|
// Sourcemaps
|
||||||
|
|
||||||
gulp.task('upload-vscode-sourcemaps', ['vscode-darwin-min', 'minify-vscode'], () => {
|
gulp.task('upload-vscode-sourcemaps', () => {
|
||||||
const vs = gulp.src('out-vscode-min/**/*.map', { base: 'out-vscode-min' })
|
const vs = gulp.src('out-vscode-min/**/*.map', { base: 'out-vscode-min' })
|
||||||
.pipe(es.mapSync(f => {
|
.pipe(es.mapSync(f => {
|
||||||
f.path = `${f.base}/core/${f.relative}`;
|
f.path = `${f.base}/core/${f.relative}`;
|
||||||
@@ -583,57 +586,8 @@ gulp.task('upload-vscode-sourcemaps', ['vscode-darwin-min', 'minify-vscode'], ()
|
|||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
const allConfigDetailsPath = path.join(os.tmpdir(), 'configuration.json');
|
|
||||||
gulp.task('upload-vscode-configuration', ['generate-vscode-configuration'], () => {
|
|
||||||
if (!shouldSetupSettingsSearch()) {
|
|
||||||
const branch = process.env.BUILD_SOURCEBRANCH;
|
|
||||||
console.log(`Only runs on master and release branches, not ${branch}`);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!fs.existsSync(allConfigDetailsPath)) {
|
|
||||||
throw new Error(`configuration file at ${allConfigDetailsPath} does not exist`);
|
|
||||||
}
|
|
||||||
|
|
||||||
const settingsSearchBuildId = getSettingsSearchBuildId(packageJson);
|
|
||||||
if (!settingsSearchBuildId) {
|
|
||||||
throw new Error('Failed to compute build number');
|
|
||||||
}
|
|
||||||
|
|
||||||
return gulp.src(allConfigDetailsPath)
|
|
||||||
.pipe(azure.upload({
|
|
||||||
account: process.env.AZURE_STORAGE_ACCOUNT,
|
|
||||||
key: process.env.AZURE_STORAGE_ACCESS_KEY,
|
|
||||||
container: 'configuration',
|
|
||||||
prefix: `${settingsSearchBuildId}/${commit}/`
|
|
||||||
}));
|
|
||||||
});
|
|
||||||
|
|
||||||
function shouldSetupSettingsSearch() {
|
|
||||||
const branch = process.env.BUILD_SOURCEBRANCH;
|
|
||||||
return branch && (/\/master$/.test(branch) || branch.indexOf('/release/') >= 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
function getSettingsSearchBuildId(packageJson) {
|
|
||||||
try {
|
|
||||||
const branch = process.env.BUILD_SOURCEBRANCH;
|
|
||||||
const branchId = branch.indexOf('/release/') >= 0 ? 0 :
|
|
||||||
/\/master$/.test(branch) ? 1 :
|
|
||||||
2; // Some unexpected branch
|
|
||||||
|
|
||||||
const out = cp.execSync(`git rev-list HEAD --count`);
|
|
||||||
const count = parseInt(out.toString());
|
|
||||||
|
|
||||||
// <version number><commit count><branchId (avoid unlikely conflicts)>
|
|
||||||
// 1.25.1, 1,234,567 commits, master = 1250112345671
|
|
||||||
return util.versionStringToNumber(packageJson.version) * 1e8 + count * 10 + branchId;
|
|
||||||
} catch (e) {
|
|
||||||
throw new Error('Could not determine build number: ' + e.toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// This task is only run for the MacOS build
|
// This task is only run for the MacOS build
|
||||||
gulp.task('generate-vscode-configuration', () => {
|
const generateVSCodeConfigurationTask = task.define('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'];
|
||||||
if (!buildDir) {
|
if (!buildDir) {
|
||||||
@@ -670,6 +624,61 @@ gulp.task('generate-vscode-configuration', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const allConfigDetailsPath = path.join(os.tmpdir(), 'configuration.json');
|
||||||
|
gulp.task(task.define(
|
||||||
|
'upload-vscode-configuration',
|
||||||
|
task.series(
|
||||||
|
generateVSCodeConfigurationTask,
|
||||||
|
() => {
|
||||||
|
if (!shouldSetupSettingsSearch()) {
|
||||||
|
const branch = process.env.BUILD_SOURCEBRANCH;
|
||||||
|
console.log(`Only runs on master and release branches, not ${branch}`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!fs.existsSync(allConfigDetailsPath)) {
|
||||||
|
throw new Error(`configuration file at ${allConfigDetailsPath} does not exist`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const settingsSearchBuildId = getSettingsSearchBuildId(packageJson);
|
||||||
|
if (!settingsSearchBuildId) {
|
||||||
|
throw new Error('Failed to compute build number');
|
||||||
|
}
|
||||||
|
|
||||||
|
return gulp.src(allConfigDetailsPath)
|
||||||
|
.pipe(azure.upload({
|
||||||
|
account: process.env.AZURE_STORAGE_ACCOUNT,
|
||||||
|
key: process.env.AZURE_STORAGE_ACCESS_KEY,
|
||||||
|
container: 'configuration',
|
||||||
|
prefix: `${settingsSearchBuildId}/${commit}/`
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
)
|
||||||
|
));
|
||||||
|
|
||||||
|
function shouldSetupSettingsSearch() {
|
||||||
|
const branch = process.env.BUILD_SOURCEBRANCH;
|
||||||
|
return branch && (/\/master$/.test(branch) || branch.indexOf('/release/') >= 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getSettingsSearchBuildId(packageJson) {
|
||||||
|
try {
|
||||||
|
const branch = process.env.BUILD_SOURCEBRANCH;
|
||||||
|
const branchId = branch.indexOf('/release/') >= 0 ? 0 :
|
||||||
|
/\/master$/.test(branch) ? 1 :
|
||||||
|
2; // Some unexpected branch
|
||||||
|
|
||||||
|
const out = cp.execSync(`git rev-list HEAD --count`);
|
||||||
|
const count = parseInt(out.toString());
|
||||||
|
|
||||||
|
// <version number><commit count><branchId (avoid unlikely conflicts)>
|
||||||
|
// 1.25.1, 1,234,567 commits, master = 1250112345671
|
||||||
|
return util.versionStringToNumber(packageJson.version) * 1e8 + count * 10 + branchId;
|
||||||
|
} catch (e) {
|
||||||
|
throw new Error('Could not determine build number: ' + e.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
// Install service locally before building carbon
|
// Install service locally before building carbon
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ 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');
|
||||||
|
const task = require('./lib/task');
|
||||||
const packageJson = require('../package.json');
|
const packageJson = require('../package.json');
|
||||||
const product = require('../product.json');
|
const product = require('../product.json');
|
||||||
const rpmDependencies = require('../resources/linux/rpm/dependencies.json');
|
const rpmDependencies = require('../resources/linux/rpm/dependencies.json');
|
||||||
@@ -42,7 +43,7 @@ function prepareDebPackage(arch) {
|
|||||||
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
||||||
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
|
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
|
||||||
.pipe(replace('@@NAME@@', product.applicationName))
|
.pipe(replace('@@NAME@@', product.applicationName))
|
||||||
.pipe(replace('@@ICON@@', product.applicationName))
|
.pipe(replace('@@ICON@@', product.linuxIconName))
|
||||||
.pipe(replace('@@URLPROTOCOL@@', product.urlProtocol));
|
.pipe(replace('@@URLPROTOCOL@@', product.urlProtocol));
|
||||||
|
|
||||||
const appdata = gulp.src('resources/linux/code.appdata.xml', { base: '.' })
|
const appdata = gulp.src('resources/linux/code.appdata.xml', { base: '.' })
|
||||||
@@ -52,7 +53,7 @@ function prepareDebPackage(arch) {
|
|||||||
.pipe(rename('usr/share/appdata/' + product.applicationName + '.appdata.xml'));
|
.pipe(rename('usr/share/appdata/' + product.applicationName + '.appdata.xml'));
|
||||||
|
|
||||||
const icon = gulp.src('resources/linux/code.png', { base: '.' })
|
const icon = gulp.src('resources/linux/code.png', { base: '.' })
|
||||||
.pipe(rename('usr/share/pixmaps/' + product.applicationName + '.png'));
|
.pipe(rename('usr/share/pixmaps/' + product.linuxIconName + '.png'));
|
||||||
|
|
||||||
// const bash_completion = gulp.src('resources/completions/bash/code')
|
// const bash_completion = gulp.src('resources/completions/bash/code')
|
||||||
// .pipe(rename('usr/share/bash-completion/completions/code'));
|
// .pipe(rename('usr/share/bash-completion/completions/code'));
|
||||||
@@ -133,7 +134,7 @@ function prepareRpmPackage(arch) {
|
|||||||
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
||||||
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
|
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
|
||||||
.pipe(replace('@@NAME@@', product.applicationName))
|
.pipe(replace('@@NAME@@', product.applicationName))
|
||||||
.pipe(replace('@@ICON@@', product.applicationName))
|
.pipe(replace('@@ICON@@', product.linuxIconName))
|
||||||
.pipe(replace('@@URLPROTOCOL@@', product.urlProtocol));
|
.pipe(replace('@@URLPROTOCOL@@', product.urlProtocol));
|
||||||
|
|
||||||
const appdata = gulp.src('resources/linux/code.appdata.xml', { base: '.' })
|
const appdata = gulp.src('resources/linux/code.appdata.xml', { base: '.' })
|
||||||
@@ -143,7 +144,7 @@ function prepareRpmPackage(arch) {
|
|||||||
.pipe(rename('usr/share/appdata/' + product.applicationName + '.appdata.xml'));
|
.pipe(rename('usr/share/appdata/' + product.applicationName + '.appdata.xml'));
|
||||||
|
|
||||||
const icon = gulp.src('resources/linux/code.png', { base: '.' })
|
const icon = gulp.src('resources/linux/code.png', { base: '.' })
|
||||||
.pipe(rename('BUILD/usr/share/pixmaps/' + product.applicationName + '.png'));
|
.pipe(rename('BUILD/usr/share/pixmaps/' + product.linuxIconName + '.png'));
|
||||||
|
|
||||||
// const bash_completion = gulp.src('resources/completions/bash/code')
|
// const bash_completion = gulp.src('resources/completions/bash/code')
|
||||||
// .pipe(rename('BUILD/usr/share/bash-completion/completions/code'));
|
// .pipe(rename('BUILD/usr/share/bash-completion/completions/code'));
|
||||||
@@ -157,6 +158,7 @@ function prepareRpmPackage(arch) {
|
|||||||
const spec = gulp.src('resources/linux/rpm/code.spec.template', { base: '.' })
|
const spec = gulp.src('resources/linux/rpm/code.spec.template', { base: '.' })
|
||||||
.pipe(replace('@@NAME@@', product.applicationName))
|
.pipe(replace('@@NAME@@', product.applicationName))
|
||||||
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
||||||
|
.pipe(replace('@@ICON@@', product.linuxIconName))
|
||||||
.pipe(replace('@@VERSION@@', packageJson.version))
|
.pipe(replace('@@VERSION@@', packageJson.version))
|
||||||
.pipe(replace('@@RELEASE@@', linuxPackageRevision))
|
.pipe(replace('@@RELEASE@@', linuxPackageRevision))
|
||||||
.pipe(replace('@@ARCHITECTURE@@', rpmArch))
|
.pipe(replace('@@ARCHITECTURE@@', rpmArch))
|
||||||
@@ -195,7 +197,8 @@ function getSnapBuildPath(arch) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function prepareSnapPackage(arch) {
|
function prepareSnapPackage(arch) {
|
||||||
const binaryDir = '../VSCode-linux-' + arch;
|
// {{SQL CARBON EDIT}}
|
||||||
|
const binaryDir = '../azuredatastudio-linux-' + arch;
|
||||||
const destination = getSnapBuildPath(arch);
|
const destination = getSnapBuildPath(arch);
|
||||||
|
|
||||||
return function () {
|
return function () {
|
||||||
@@ -203,11 +206,11 @@ function prepareSnapPackage(arch) {
|
|||||||
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
||||||
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
|
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
|
||||||
.pipe(replace('@@NAME@@', product.applicationName))
|
.pipe(replace('@@NAME@@', product.applicationName))
|
||||||
.pipe(replace('@@ICON@@', `/usr/share/pixmaps/${product.applicationName}.png`))
|
.pipe(replace('@@ICON@@', `/usr/share/pixmaps/${product.linuxIconName}.png`))
|
||||||
.pipe(rename(`usr/share/applications/${product.applicationName}.desktop`));
|
.pipe(rename(`usr/share/applications/${product.applicationName}.desktop`));
|
||||||
|
|
||||||
const icon = gulp.src('resources/linux/code.png', { base: '.' })
|
const icon = gulp.src('resources/linux/code.png', { base: '.' })
|
||||||
.pipe(rename(`usr/share/pixmaps/${product.applicationName}.png`));
|
.pipe(rename(`usr/share/pixmaps/${product.linuxIconName}.png`));
|
||||||
|
|
||||||
const code = gulp.src(binaryDir + '/**/*', { base: binaryDir })
|
const code = gulp.src(binaryDir + '/**/*', { base: binaryDir })
|
||||||
.pipe(rename(function (p) { p.dirname = `usr/share/${product.applicationName}/${p.dirname}`; }));
|
.pipe(rename(function (p) { p.dirname = `usr/share/${product.applicationName}/${p.dirname}`; }));
|
||||||
@@ -231,116 +234,36 @@ function buildSnapPackage(arch) {
|
|||||||
return shell.task(`cd ${snapBuildPath} && snapcraft build`);
|
return shell.task(`cd ${snapBuildPath} && snapcraft build`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getFlatpakArch(arch) {
|
const BUILD_TARGETS = [
|
||||||
return { x64: 'x86_64', ia32: 'i386', arm: 'arm' }[arch];
|
{ arch: 'ia32' },
|
||||||
}
|
{ arch: 'x64' },
|
||||||
|
{ arch: 'arm' },
|
||||||
function prepareFlatpak(arch) {
|
{ arch: 'arm64' },
|
||||||
// {{SQL CARBON EDIT}}
|
|
||||||
const binaryDir = '../azuredatastudio-linux-' + arch;
|
|
||||||
const flatpakArch = getFlatpakArch(arch);
|
|
||||||
const destination = '.build/linux/flatpak/' + flatpakArch;
|
|
||||||
|
|
||||||
return function () {
|
|
||||||
// This is not imported in the global scope to avoid requiring ImageMagick
|
|
||||||
// (or GraphicsMagick) when not building building Flatpak bundles.
|
|
||||||
const imgResize = require('gulp-image-resize');
|
|
||||||
|
|
||||||
const all = [16, 24, 32, 48, 64, 128, 192, 256, 512].map(function (size) {
|
|
||||||
return gulp.src('resources/linux/code.png', { base: '.' })
|
|
||||||
.pipe(imgResize({ width: size, height: size, format: "png", noProfile: true }))
|
|
||||||
.pipe(rename('share/icons/hicolor/' + size + 'x' + size + '/apps/' + flatpakManifest.appId + '.png'));
|
|
||||||
});
|
|
||||||
|
|
||||||
all.push(gulp.src('resources/linux/code.desktop', { base: '.' })
|
|
||||||
.pipe(replace('Exec=/usr/share/@@NAME@@/@@NAME@@', 'Exec=' + product.applicationName))
|
|
||||||
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
|
||||||
.pipe(replace('@@NAME_SHORT@@', product.nameShort))
|
|
||||||
.pipe(replace('@@NAME@@', product.applicationName))
|
|
||||||
.pipe(rename('share/applications/' + flatpakManifest.appId + '.desktop')));
|
|
||||||
|
|
||||||
all.push(gulp.src('resources/linux/code.appdata.xml', { base: '.' })
|
|
||||||
.pipe(replace('@@NAME_LONG@@', product.nameLong))
|
|
||||||
.pipe(replace('@@NAME@@', flatpakManifest.appId))
|
|
||||||
.pipe(replace('@@LICENSE@@', product.licenseName))
|
|
||||||
.pipe(rename('share/appdata/' + flatpakManifest.appId + '.appdata.xml')));
|
|
||||||
|
|
||||||
all.push(gulp.src(binaryDir + '/**/*', { base: binaryDir })
|
|
||||||
.pipe(rename(function (p) {
|
|
||||||
p.dirname = 'share/' + product.applicationName + '/' + p.dirname;
|
|
||||||
})));
|
|
||||||
|
|
||||||
return es.merge(all).pipe(vfs.dest(destination));
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function buildFlatpak(arch) {
|
|
||||||
const flatpakArch = getFlatpakArch(arch);
|
|
||||||
const manifest = {};
|
|
||||||
for (var k in flatpakManifest) {
|
|
||||||
manifest[k] = flatpakManifest[k];
|
|
||||||
}
|
|
||||||
manifest.files = [
|
|
||||||
['.build/linux/flatpak/' + flatpakArch, '/'],
|
|
||||||
];
|
];
|
||||||
const buildOptions = {
|
|
||||||
arch: flatpakArch,
|
BUILD_TARGETS.forEach((buildTarget) => {
|
||||||
subject: product.nameLong + ' ' + packageJson.version + '.' + linuxPackageRevision,
|
const arch = buildTarget.arch;
|
||||||
};
|
|
||||||
// If requested, use the configured path for the OSTree repository.
|
{
|
||||||
if (process.env.FLATPAK_REPO) {
|
const debArch = getDebPackageArch(arch);
|
||||||
buildOptions.repoDir = process.env.FLATPAK_REPO;
|
const prepareDebTask = task.define(`vscode-linux-${arch}-prepare-deb`, task.series(util.rimraf(`.build/linux/deb/${debArch}`), prepareDebPackage(arch)));
|
||||||
} else {
|
// gulp.task(prepareDebTask);
|
||||||
buildOptions.bundlePath = manifest.appId + '-' + flatpakArch + '.flatpak';
|
const buildDebTask = task.define(`vscode-linux-${arch}-build-deb`, task.series(prepareDebTask, buildDebPackage(arch)));
|
||||||
}
|
gulp.task(buildDebTask);
|
||||||
// Setup PGP signing if requested.
|
|
||||||
if (process.env.GPG_KEY_ID !== undefined) {
|
|
||||||
buildOptions.gpgSign = process.env.GPG_KEY_ID;
|
|
||||||
if (process.env.GPG_HOMEDIR) {
|
|
||||||
buildOptions.gpgHomedir = process.env.GPG_HOME_DIR;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return function (cb) {
|
|
||||||
require('flatpak-bundler').bundle(manifest, buildOptions, cb);
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gulp.task('clean-vscode-linux-ia32-deb', util.rimraf('.build/linux/deb/i386'));
|
{
|
||||||
gulp.task('clean-vscode-linux-x64-deb', util.rimraf('.build/linux/deb/amd64'));
|
const rpmArch = getRpmPackageArch(arch);
|
||||||
gulp.task('clean-vscode-linux-arm-deb', util.rimraf('.build/linux/deb/armhf'));
|
const prepareRpmTask = task.define(`vscode-linux-${arch}-prepare-rpm`, task.series(util.rimraf(`.build/linux/rpm/${rpmArch}`), prepareRpmPackage(arch)));
|
||||||
gulp.task('clean-vscode-linux-arm64-deb', util.rimraf('.build/linux/deb/arm64'));
|
// gulp.task(prepareRpmTask);
|
||||||
gulp.task('clean-vscode-linux-ia32-rpm', util.rimraf('.build/linux/rpm/i386'));
|
const buildRpmTask = task.define(`vscode-linux-${arch}-build-rpm`, task.series(prepareRpmTask, buildRpmPackage(arch)));
|
||||||
gulp.task('clean-vscode-linux-x64-rpm', util.rimraf('.build/linux/rpm/x86_64'));
|
gulp.task(buildRpmTask);
|
||||||
gulp.task('clean-vscode-linux-arm-rpm', util.rimraf('.build/linux/rpm/armhf'));
|
}
|
||||||
gulp.task('clean-vscode-linux-arm64-rpm', util.rimraf('.build/linux/rpm/arm64'));
|
|
||||||
gulp.task('clean-vscode-linux-ia32-snap', util.rimraf('.build/linux/snap/x64'));
|
|
||||||
gulp.task('clean-vscode-linux-x64-snap', util.rimraf('.build/linux/snap/x64'));
|
|
||||||
gulp.task('clean-vscode-linux-arm-snap', util.rimraf('.build/linux/snap/x64'));
|
|
||||||
gulp.task('clean-vscode-linux-arm64-snap', util.rimraf('.build/linux/snap/x64'));
|
|
||||||
|
|
||||||
gulp.task('vscode-linux-ia32-prepare-deb', ['clean-vscode-linux-ia32-deb'], prepareDebPackage('ia32'));
|
{
|
||||||
gulp.task('vscode-linux-x64-prepare-deb', ['clean-vscode-linux-x64-deb'], prepareDebPackage('x64'));
|
const prepareSnapTask = task.define(`vscode-linux-${arch}-prepare-snap`, task.series(util.rimraf(`.build/linux/snap/${arch}`), prepareSnapPackage(arch)));
|
||||||
gulp.task('vscode-linux-arm-prepare-deb', ['clean-vscode-linux-arm-deb'], prepareDebPackage('arm'));
|
gulp.task(prepareSnapTask);
|
||||||
gulp.task('vscode-linux-arm64-prepare-deb', ['clean-vscode-linux-arm64-deb'], prepareDebPackage('arm64'));
|
const buildSnapTask = task.define(`vscode-linux-${arch}-build-snap`, task.series(prepareSnapTask, buildSnapPackage(arch)));
|
||||||
gulp.task('vscode-linux-ia32-build-deb', ['vscode-linux-ia32-prepare-deb'], buildDebPackage('ia32'));
|
gulp.task(buildSnapTask);
|
||||||
gulp.task('vscode-linux-x64-build-deb', ['vscode-linux-x64-prepare-deb'], buildDebPackage('x64'));
|
}
|
||||||
gulp.task('vscode-linux-arm-build-deb', ['vscode-linux-arm-prepare-deb'], buildDebPackage('arm'));
|
});
|
||||||
gulp.task('vscode-linux-arm64-build-deb', ['vscode-linux-arm64-prepare-deb'], buildDebPackage('arm64'));
|
|
||||||
|
|
||||||
gulp.task('vscode-linux-ia32-prepare-rpm', ['clean-vscode-linux-ia32-rpm'], prepareRpmPackage('ia32'));
|
|
||||||
gulp.task('vscode-linux-x64-prepare-rpm', ['clean-vscode-linux-x64-rpm'], prepareRpmPackage('x64'));
|
|
||||||
gulp.task('vscode-linux-arm-prepare-rpm', ['clean-vscode-linux-arm-rpm'], prepareRpmPackage('arm'));
|
|
||||||
gulp.task('vscode-linux-arm64-prepare-rpm', ['clean-vscode-linux-arm64-rpm'], prepareRpmPackage('arm64'));
|
|
||||||
gulp.task('vscode-linux-ia32-build-rpm', ['vscode-linux-ia32-prepare-rpm'], buildRpmPackage('ia32'));
|
|
||||||
gulp.task('vscode-linux-x64-build-rpm', ['vscode-linux-x64-prepare-rpm'], buildRpmPackage('x64'));
|
|
||||||
gulp.task('vscode-linux-arm-build-rpm', ['vscode-linux-arm-prepare-rpm'], buildRpmPackage('arm'));
|
|
||||||
gulp.task('vscode-linux-arm64-build-rpm', ['vscode-linux-arm64-prepare-rpm'], buildRpmPackage('arm64'));
|
|
||||||
|
|
||||||
gulp.task('vscode-linux-ia32-prepare-snap', ['clean-vscode-linux-ia32-snap'], prepareSnapPackage('ia32'));
|
|
||||||
gulp.task('vscode-linux-x64-prepare-snap', ['clean-vscode-linux-x64-snap'], prepareSnapPackage('x64'));
|
|
||||||
gulp.task('vscode-linux-arm-prepare-snap', ['clean-vscode-linux-arm-snap'], prepareSnapPackage('arm'));
|
|
||||||
gulp.task('vscode-linux-arm64-prepare-snap', ['clean-vscode-linux-arm64-snap'], prepareSnapPackage('arm64'));
|
|
||||||
gulp.task('vscode-linux-ia32-build-snap', ['vscode-linux-ia32-prepare-snap'], buildSnapPackage('ia32'));
|
|
||||||
gulp.task('vscode-linux-x64-build-snap', ['vscode-linux-x64-prepare-snap'], buildSnapPackage('x64'));
|
|
||||||
gulp.task('vscode-linux-arm-build-snap', ['vscode-linux-arm-prepare-snap'], buildSnapPackage('arm'));
|
|
||||||
gulp.task('vscode-linux-arm64-build-snap', ['vscode-linux-arm64-prepare-snap'], buildSnapPackage('arm64'));
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ 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');
|
||||||
|
const task = require('./lib/task');
|
||||||
const pkg = require('../package.json');
|
const pkg = require('../package.json');
|
||||||
const product = require('../product.json');
|
const product = require('../product.json');
|
||||||
const vfs = require('vinyl-fs');
|
const vfs = require('vinyl-fs');
|
||||||
@@ -107,8 +108,8 @@ function buildWin32Setup(arch, target) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function defineWin32SetupTasks(arch, target) {
|
function defineWin32SetupTasks(arch, target) {
|
||||||
gulp.task(`clean-vscode-win32-${arch}-${target}-setup`, util.rimraf(setupDir(arch, target)));
|
const cleanTask = util.rimraf(setupDir(arch, target));
|
||||||
gulp.task(`vscode-win32-${arch}-${target}-setup`, [`clean-vscode-win32-${arch}-${target}-setup`], buildWin32Setup(arch, target));
|
gulp.task(task.define(`vscode-win32-${arch}-${target}-setup`, task.series(cleanTask, buildWin32Setup(arch, target))));
|
||||||
}
|
}
|
||||||
|
|
||||||
defineWin32SetupTasks('ia32', 'system');
|
defineWin32SetupTasks('ia32', 'system');
|
||||||
@@ -126,11 +127,8 @@ function archiveWin32Setup(arch) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
gulp.task('clean-vscode-win32-ia32-archive', util.rimraf(zipDir('ia32')));
|
gulp.task(task.define('vscode-win32-ia32-archive', task.series(util.rimraf(zipDir('ia32')), archiveWin32Setup('ia32'))));
|
||||||
gulp.task('vscode-win32-ia32-archive', ['clean-vscode-win32-ia32-archive'], archiveWin32Setup('ia32'));
|
gulp.task(task.define('vscode-win32-x64-archive', task.series(util.rimraf(zipDir('x64')), archiveWin32Setup('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'));
|
|
||||||
|
|
||||||
function copyInnoUpdater(arch) {
|
function copyInnoUpdater(arch) {
|
||||||
return () => {
|
return () => {
|
||||||
@@ -139,9 +137,6 @@ function copyInnoUpdater(arch) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
gulp.task('vscode-win32-ia32-copy-inno-updater', copyInnoUpdater('ia32'));
|
|
||||||
gulp.task('vscode-win32-x64-copy-inno-updater', copyInnoUpdater('x64'));
|
|
||||||
|
|
||||||
function patchInnoUpdater(arch) {
|
function patchInnoUpdater(arch) {
|
||||||
return cb => {
|
return cb => {
|
||||||
const icon = path.join(repoPath, 'resources', 'win32', 'code.ico');
|
const icon = path.join(repoPath, 'resources', 'win32', 'code.ico');
|
||||||
@@ -149,5 +144,5 @@ function patchInnoUpdater(arch) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
gulp.task('vscode-win32-ia32-inno-updater', ['vscode-win32-ia32-copy-inno-updater'], patchInnoUpdater('ia32'));
|
gulp.task(task.define('vscode-win32-ia32-inno-updater', task.series(copyInnoUpdater('ia32'), patchInnoUpdater('ia32'))));
|
||||||
gulp.task('vscode-win32-x64-inno-updater', ['vscode-win32-x64-copy-inno-updater'], patchInnoUpdater('x64'));
|
gulp.task(task.define('vscode-win32-x64-inno-updater', task.series(copyInnoUpdater('x64'), patchInnoUpdater('x64'))));
|
||||||
@@ -14,7 +14,8 @@ const es = require('event-stream');
|
|||||||
const rename = require('gulp-rename');
|
const rename = require('gulp-rename');
|
||||||
const vfs = require('vinyl-fs');
|
const vfs = require('vinyl-fs');
|
||||||
const ext = require('./extensions');
|
const ext = require('./extensions');
|
||||||
const util = require('gulp-util');
|
const fancyLog = require('fancy-log');
|
||||||
|
const ansiColors = require('ansi-colors');
|
||||||
|
|
||||||
const root = path.dirname(path.dirname(__dirname));
|
const root = path.dirname(path.dirname(__dirname));
|
||||||
const builtInExtensions = require('../builtInExtensions.json');
|
const builtInExtensions = require('../builtInExtensions.json');
|
||||||
@@ -43,7 +44,7 @@ function isUpToDate(extension) {
|
|||||||
|
|
||||||
function syncMarketplaceExtension(extension) {
|
function syncMarketplaceExtension(extension) {
|
||||||
if (isUpToDate(extension)) {
|
if (isUpToDate(extension)) {
|
||||||
util.log(util.colors.blue('[marketplace]'), `${extension.name}@${extension.version}`, util.colors.green('✔︎'));
|
fancyLog(ansiColors.blue('[marketplace]'), `${extension.name}@${extension.version}`, ansiColors.green('✔︎'));
|
||||||
return es.readArray([]);
|
return es.readArray([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,13 +53,13 @@ function syncMarketplaceExtension(extension) {
|
|||||||
return ext.fromMarketplace(extension.name, extension.version, extension.metadata)
|
return ext.fromMarketplace(extension.name, extension.version, extension.metadata)
|
||||||
.pipe(rename(p => p.dirname = `${extension.name}/${p.dirname}`))
|
.pipe(rename(p => p.dirname = `${extension.name}/${p.dirname}`))
|
||||||
.pipe(vfs.dest('.build/builtInExtensions'))
|
.pipe(vfs.dest('.build/builtInExtensions'))
|
||||||
.on('end', () => util.log(util.colors.blue('[marketplace]'), extension.name, util.colors.green('✔︎')));
|
.on('end', () => fancyLog(ansiColors.blue('[marketplace]'), extension.name, ansiColors.green('✔︎')));
|
||||||
}
|
}
|
||||||
|
|
||||||
function syncExtension(extension, controlState) {
|
function syncExtension(extension, controlState) {
|
||||||
switch (controlState) {
|
switch (controlState) {
|
||||||
case 'disabled':
|
case 'disabled':
|
||||||
util.log(util.colors.blue('[disabled]'), util.colors.gray(extension.name));
|
fancyLog(ansiColors.blue('[disabled]'), ansiColors.gray(extension.name));
|
||||||
return es.readArray([]);
|
return es.readArray([]);
|
||||||
|
|
||||||
case 'marketplace':
|
case 'marketplace':
|
||||||
@@ -66,15 +67,15 @@ function syncExtension(extension, controlState) {
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
if (!fs.existsSync(controlState)) {
|
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.`));
|
fancyLog(ansiColors.red(`Error: Built-in extension '${extension.name}' is configured to run from '${controlState}' but that path does not exist.`));
|
||||||
return es.readArray([]);
|
return es.readArray([]);
|
||||||
|
|
||||||
} else if (!fs.existsSync(path.join(controlState, 'package.json'))) {
|
} 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.`));
|
fancyLog(ansiColors.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([]);
|
return es.readArray([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
util.log(util.colors.blue('[local]'), `${extension.name}: ${util.colors.cyan(controlState)}`, util.colors.green('✔︎'));
|
fancyLog(ansiColors.blue('[local]'), `${extension.name}: ${ansiColors.cyan(controlState)}`, ansiColors.green('✔︎'));
|
||||||
return es.readArray([]);
|
return es.readArray([]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -93,8 +94,8 @@ function writeControlFile(control) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function main() {
|
function main() {
|
||||||
util.log('Syncronizing built-in extensions...');
|
fancyLog('Syncronizing built-in extensions...');
|
||||||
util.log(`You can manage built-in extensions with the ${util.colors.cyan('--builtin')} flag`);
|
fancyLog(`You can manage built-in extensions with the ${ansiColors.cyan('--builtin')} flag`);
|
||||||
|
|
||||||
const control = readControlFile();
|
const control = readControlFile();
|
||||||
const streams = [];
|
const streams = [];
|
||||||
|
|||||||
@@ -16,7 +16,8 @@ const monacodts = require("../monaco/api");
|
|||||||
const nls = require("./nls");
|
const nls = require("./nls");
|
||||||
const reporter_1 = require("./reporter");
|
const reporter_1 = require("./reporter");
|
||||||
const util = require("./util");
|
const util = require("./util");
|
||||||
const util2 = require("gulp-util");
|
const fancyLog = require("fancy-log");
|
||||||
|
const ansiColors = require("ansi-colors");
|
||||||
const watch = require('./watch');
|
const watch = require('./watch');
|
||||||
const reporter = reporter_1.createReporter();
|
const reporter = reporter_1.createReporter();
|
||||||
function getTypeScriptCompilerOptions(src) {
|
function getTypeScriptCompilerOptions(src) {
|
||||||
@@ -179,7 +180,7 @@ class MonacoGenerator {
|
|||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
_log(message, ...rest) {
|
_log(message, ...rest) {
|
||||||
util2.log(util2.colors.cyan('[monaco.d.ts]'), message, ...rest);
|
fancyLog(ansiColors.cyan('[monaco.d.ts]'), message, ...rest);
|
||||||
}
|
}
|
||||||
execute() {
|
execute() {
|
||||||
const startTime = Date.now();
|
const startTime = Date.now();
|
||||||
|
|||||||
@@ -17,7 +17,9 @@ import * as monacodts from '../monaco/api';
|
|||||||
import * as nls from './nls';
|
import * as nls from './nls';
|
||||||
import { createReporter } from './reporter';
|
import { createReporter } from './reporter';
|
||||||
import * as util from './util';
|
import * as util from './util';
|
||||||
import * as util2 from 'gulp-util';
|
import * as fancyLog from 'fancy-log';
|
||||||
|
import * as ansiColors from 'ansi-colors';
|
||||||
|
|
||||||
const watch = require('./watch');
|
const watch = require('./watch');
|
||||||
|
|
||||||
const reporter = createReporter();
|
const reporter = createReporter();
|
||||||
@@ -218,7 +220,7 @@ class MonacoGenerator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _log(message: any, ...rest: any[]): void {
|
private _log(message: any, ...rest: any[]): void {
|
||||||
util2.log(util2.colors.cyan('[monaco.d.ts]'), message, ...rest);
|
fancyLog(ansiColors.cyan('[monaco.d.ts]'), message, ...rest);
|
||||||
}
|
}
|
||||||
|
|
||||||
public execute(): void {
|
public execute(): void {
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ const remote = require("gulp-remote-src");
|
|||||||
const vzip = require('gulp-vinyl-zip');
|
const vzip = require('gulp-vinyl-zip');
|
||||||
const filter = require("gulp-filter");
|
const filter = require("gulp-filter");
|
||||||
const rename = require("gulp-rename");
|
const rename = require("gulp-rename");
|
||||||
const util = require('gulp-util');
|
const fancyLog = require("fancy-log");
|
||||||
|
const ansiColors = require("ansi-colors");
|
||||||
const buffer = require('gulp-buffer');
|
const buffer = require('gulp-buffer');
|
||||||
const json = require("gulp-json-editor");
|
const json = require("gulp-json-editor");
|
||||||
const webpack = require('webpack');
|
const webpack = require('webpack');
|
||||||
@@ -136,7 +137,7 @@ function fromLocalWebpack(extensionPath, sourceMappingURLBase) {
|
|||||||
.pipe(packageJsonFilter.restore);
|
.pipe(packageJsonFilter.restore);
|
||||||
const webpackStreams = webpackConfigLocations.map(webpackConfigPath => () => {
|
const webpackStreams = webpackConfigLocations.map(webpackConfigPath => () => {
|
||||||
const webpackDone = (err, stats) => {
|
const webpackDone = (err, stats) => {
|
||||||
util.log(`Bundled extension: ${util.colors.yellow(path.join(path.basename(extensionPath), path.relative(extensionPath, webpackConfigPath)))}...`);
|
fancyLog(`Bundled extension: ${ansiColors.yellow(path.join(path.basename(extensionPath), path.relative(extensionPath, webpackConfigPath)))}...`);
|
||||||
if (err) {
|
if (err) {
|
||||||
result.emit('error', err);
|
result.emit('error', err);
|
||||||
}
|
}
|
||||||
@@ -214,7 +215,7 @@ const baseHeaders = {
|
|||||||
function fromMarketplace(extensionName, version, metadata) {
|
function fromMarketplace(extensionName, version, metadata) {
|
||||||
const [publisher, name] = extensionName.split('.');
|
const [publisher, name] = extensionName.split('.');
|
||||||
const url = `https://marketplace.visualstudio.com/_apis/public/gallery/publishers/${publisher}/vsextensions/${name}/${version}/vspackage`;
|
const url = `https://marketplace.visualstudio.com/_apis/public/gallery/publishers/${publisher}/vsextensions/${name}/${version}/vspackage`;
|
||||||
util.log('Downloading extension:', util.colors.yellow(`${extensionName}@${version}`), '...');
|
fancyLog('Downloading extension:', ansiColors.yellow(`${extensionName}@${version}`), '...');
|
||||||
const options = {
|
const options = {
|
||||||
base: url,
|
base: url,
|
||||||
requestOptions: {
|
requestOptions: {
|
||||||
|
|||||||
@@ -17,7 +17,8 @@ import remote = require('gulp-remote-src');
|
|||||||
const vzip = require('gulp-vinyl-zip');
|
const vzip = require('gulp-vinyl-zip');
|
||||||
import filter = require('gulp-filter');
|
import filter = require('gulp-filter');
|
||||||
import rename = require('gulp-rename');
|
import rename = require('gulp-rename');
|
||||||
const util = require('gulp-util');
|
import * as fancyLog from 'fancy-log';
|
||||||
|
import * as ansiColors from 'ansi-colors';
|
||||||
const buffer = require('gulp-buffer');
|
const buffer = require('gulp-buffer');
|
||||||
import json = require('gulp-json-editor');
|
import json = require('gulp-json-editor');
|
||||||
const webpack = require('webpack');
|
const webpack = require('webpack');
|
||||||
@@ -155,7 +156,7 @@ function fromLocalWebpack(extensionPath: string, sourceMappingURLBase: string |
|
|||||||
const webpackStreams = webpackConfigLocations.map(webpackConfigPath => () => {
|
const webpackStreams = webpackConfigLocations.map(webpackConfigPath => () => {
|
||||||
|
|
||||||
const webpackDone = (err: any, stats: any) => {
|
const webpackDone = (err: any, stats: any) => {
|
||||||
util.log(`Bundled extension: ${util.colors.yellow(path.join(path.basename(extensionPath), path.relative(extensionPath, webpackConfigPath)))}...`);
|
fancyLog(`Bundled extension: ${ansiColors.yellow(path.join(path.basename(extensionPath), path.relative(extensionPath, webpackConfigPath)))}...`);
|
||||||
if (err) {
|
if (err) {
|
||||||
result.emit('error', err);
|
result.emit('error', err);
|
||||||
}
|
}
|
||||||
@@ -249,7 +250,7 @@ export function fromMarketplace(extensionName: string, version: string, metadata
|
|||||||
const [publisher, name] = extensionName.split('.');
|
const [publisher, name] = extensionName.split('.');
|
||||||
const url = `https://marketplace.visualstudio.com/_apis/public/gallery/publishers/${publisher}/vsextensions/${name}/${version}/vspackage`;
|
const url = `https://marketplace.visualstudio.com/_apis/public/gallery/publishers/${publisher}/vsextensions/${name}/${version}/vspackage`;
|
||||||
|
|
||||||
util.log('Downloading extension:', util.colors.yellow(`${extensionName}@${version}`), '...');
|
fancyLog('Downloading extension:', ansiColors.yellow(`${extensionName}@${version}`), '...');
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
base: url,
|
base: url,
|
||||||
|
|||||||
@@ -13,11 +13,12 @@ const xml2js = require("xml2js");
|
|||||||
const glob = require("glob");
|
const glob = require("glob");
|
||||||
const https = require("https");
|
const https = require("https");
|
||||||
const gulp = require("gulp");
|
const gulp = require("gulp");
|
||||||
const util = require("gulp-util");
|
const fancyLog = require("fancy-log");
|
||||||
|
const ansiColors = require("ansi-colors");
|
||||||
const iconv = require("iconv-lite");
|
const iconv = require("iconv-lite");
|
||||||
const NUMBER_OF_CONCURRENT_DOWNLOADS = 4;
|
const NUMBER_OF_CONCURRENT_DOWNLOADS = 4;
|
||||||
function log(message, ...rest) {
|
function log(message, ...rest) {
|
||||||
util.log(util.colors.green('[i18n]'), message, ...rest);
|
fancyLog(ansiColors.green('[i18n]'), message, ...rest);
|
||||||
}
|
}
|
||||||
exports.defaultLanguages = [
|
exports.defaultLanguages = [
|
||||||
{ id: 'zh-tw', folderName: 'cht', transifexId: 'zh-hant' },
|
{ id: 'zh-tw', folderName: 'cht', transifexId: 'zh-hant' },
|
||||||
@@ -490,7 +491,7 @@ function getResource(sourceFile) {
|
|||||||
else if (/^vs\/code/.test(sourceFile)) {
|
else if (/^vs\/code/.test(sourceFile)) {
|
||||||
return { name: 'vs/code', project: workbenchProject };
|
return { name: 'vs/code', project: workbenchProject };
|
||||||
}
|
}
|
||||||
else if (/^vs\/workbench\/parts/.test(sourceFile)) {
|
else if (/^vs\/workbench\/contrib/.test(sourceFile)) {
|
||||||
resource = sourceFile.split('/', 4).join('/');
|
resource = sourceFile.split('/', 4).join('/');
|
||||||
return { name: resource, project: workbenchProject };
|
return { name: resource, project: workbenchProject };
|
||||||
}
|
}
|
||||||
@@ -578,7 +579,7 @@ function createXlfFilesForExtensions() {
|
|||||||
}
|
}
|
||||||
return _xlf;
|
return _xlf;
|
||||||
}
|
}
|
||||||
gulp.src([`./extensions/${extensionName}/package.nls.json`, `./extensions/${extensionName}/**/nls.metadata.json`]).pipe(event_stream_1.through(function (file) {
|
gulp.src([`./extensions/${extensionName}/package.nls.json`, `./extensions/${extensionName}/**/nls.metadata.json`], { allowEmpty: true }).pipe(event_stream_1.through(function (file) {
|
||||||
if (file.isBuffer()) {
|
if (file.isBuffer()) {
|
||||||
const buffer = file.contents;
|
const buffer = file.contents;
|
||||||
const basename = path.basename(file.path);
|
const basename = path.basename(file.path);
|
||||||
@@ -1038,7 +1039,7 @@ function prepareI18nPackFiles(externalExtensions, resultingTranslationPaths, pse
|
|||||||
let extensionsPacks = {};
|
let extensionsPacks = {};
|
||||||
let errors = [];
|
let errors = [];
|
||||||
return event_stream_1.through(function (xlf) {
|
return event_stream_1.through(function (xlf) {
|
||||||
let project = path.dirname(xlf.relative);
|
let project = path.basename(path.dirname(xlf.relative));
|
||||||
let resource = path.basename(xlf.relative, '.xlf');
|
let resource = path.basename(xlf.relative, '.xlf');
|
||||||
let contents = xlf.contents.toString();
|
let contents = xlf.contents.toString();
|
||||||
let parsePromise = pseudo ? XLF.parsePseudo(contents) : XLF.parse(contents);
|
let parsePromise = pseudo ? XLF.parsePseudo(contents) : XLF.parse(contents);
|
||||||
|
|||||||
@@ -27,135 +27,151 @@
|
|||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/cli",
|
"name": "vs/workbench/api/common",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/codeEditor",
|
"name": "vs/workbench/contrib/cli",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/comments",
|
"name": "vs/workbench/contrib/codeEditor",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/debug",
|
"name": "vs/workbench/contrib/codeinset",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/emmet",
|
"name": "vs/workbench/contrib/comments",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/execution",
|
"name": "vs/workbench/contrib/debug",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/extensions",
|
"name": "vs/workbench/contrib/emmet",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/feedback",
|
"name": "vs/workbench/contrib/extensions",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/files",
|
"name": "vs/workbench/contrib/externalTerminal",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/html",
|
"name": "vs/workbench/contrib/feedback",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/markers",
|
"name": "vs/workbench/contrib/files",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/localizations",
|
"name": "vs/workbench/contrib/html",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/logs",
|
"name": "vs/workbench/contrib/issue",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/output",
|
"name": "vs/workbench/contrib/markers",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/performance",
|
"name": "vs/workbench/contrib/localizations",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/preferences",
|
"name": "vs/workbench/contrib/logs",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/quickopen",
|
"name": "vs/workbench/contrib/output",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/relauncher",
|
"name": "vs/workbench/contrib/performance",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/scm",
|
"name": "vs/workbench/contrib/preferences",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/search",
|
"name": "vs/workbench/contrib/quickopen",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/snippets",
|
"name": "vs/workbench/contrib/relauncher",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/stats",
|
"name": "vs/workbench/contrib/scm",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/surveys",
|
"name": "vs/workbench/contrib/search",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/tasks",
|
"name": "vs/workbench/contrib/snippets",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/terminal",
|
"name": "vs/workbench/contrib/format",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/themes",
|
"name": "vs/workbench/contrib/stats",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/trust",
|
"name": "vs/workbench/contrib/surveys",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/update",
|
"name": "vs/workbench/contrib/tasks",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/url",
|
"name": "vs/workbench/contrib/terminal",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/watermark",
|
"name": "vs/workbench/contrib/themes",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/webview",
|
"name": "vs/workbench/contrib/trust",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/welcome",
|
"name": "vs/workbench/contrib/update",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/parts/outline",
|
"name": "vs/workbench/contrib/url",
|
||||||
|
"project": "vscode-workbench"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "vs/workbench/contrib/watermark",
|
||||||
|
"project": "vscode-workbench"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "vs/workbench/contrib/webview",
|
||||||
|
"project": "vscode-workbench"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "vs/workbench/contrib/welcome",
|
||||||
|
"project": "vscode-workbench"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "vs/workbench/contrib/outline",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -195,13 +211,17 @@
|
|||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/services/jsonschemas",
|
"name": "vs/workbench/services/extensionManagement",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/services/files",
|
"name": "vs/workbench/services/files",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "vs/workbench/services/integrity",
|
||||||
|
"project": "vscode-workbench"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "vs/workbench/services/keybinding",
|
"name": "vs/workbench/services/keybinding",
|
||||||
"project": "vscode-workbench"
|
"project": "vscode-workbench"
|
||||||
|
|||||||
@@ -13,14 +13,14 @@ import * as xml2js from 'xml2js';
|
|||||||
import * as glob from 'glob';
|
import * as glob from 'glob';
|
||||||
import * as https from 'https';
|
import * as https from 'https';
|
||||||
import * as gulp from 'gulp';
|
import * as gulp from 'gulp';
|
||||||
|
import * as fancyLog from 'fancy-log';
|
||||||
import * as util from 'gulp-util';
|
import * as ansiColors from 'ansi-colors';
|
||||||
import * as iconv from 'iconv-lite';
|
import * as iconv from 'iconv-lite';
|
||||||
|
|
||||||
const NUMBER_OF_CONCURRENT_DOWNLOADS = 4;
|
const NUMBER_OF_CONCURRENT_DOWNLOADS = 4;
|
||||||
|
|
||||||
function log(message: any, ...rest: any[]): void {
|
function log(message: any, ...rest: any[]): void {
|
||||||
util.log(util.colors.green('[i18n]'), message, ...rest);
|
fancyLog(ansiColors.green('[i18n]'), message, ...rest);
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Language {
|
export interface Language {
|
||||||
@@ -605,7 +605,7 @@ export function getResource(sourceFile: string): Resource {
|
|||||||
return { name: 'vs/base', project: editorProject };
|
return { name: 'vs/base', project: editorProject };
|
||||||
} else if (/^vs\/code/.test(sourceFile)) {
|
} else if (/^vs\/code/.test(sourceFile)) {
|
||||||
return { name: 'vs/code', project: workbenchProject };
|
return { name: 'vs/code', project: workbenchProject };
|
||||||
} else if (/^vs\/workbench\/parts/.test(sourceFile)) {
|
} else if (/^vs\/workbench\/contrib/.test(sourceFile)) {
|
||||||
resource = sourceFile.split('/', 4).join('/');
|
resource = sourceFile.split('/', 4).join('/');
|
||||||
return { name: resource, project: workbenchProject };
|
return { name: resource, project: workbenchProject };
|
||||||
} else if (/^vs\/workbench\/services/.test(sourceFile)) {
|
} else if (/^vs\/workbench\/services/.test(sourceFile)) {
|
||||||
@@ -692,7 +692,7 @@ export function createXlfFilesForExtensions(): ThroughStream {
|
|||||||
}
|
}
|
||||||
return _xlf;
|
return _xlf;
|
||||||
}
|
}
|
||||||
gulp.src([`./extensions/${extensionName}/package.nls.json`, `./extensions/${extensionName}/**/nls.metadata.json`]).pipe(through(function (file: File) {
|
gulp.src([`./extensions/${extensionName}/package.nls.json`, `./extensions/${extensionName}/**/nls.metadata.json`], { allowEmpty: true }).pipe(through(function (file: File) {
|
||||||
if (file.isBuffer()) {
|
if (file.isBuffer()) {
|
||||||
const buffer: Buffer = file.contents as Buffer;
|
const buffer: Buffer = file.contents as Buffer;
|
||||||
const basename = path.basename(file.path);
|
const basename = path.basename(file.path);
|
||||||
@@ -1194,7 +1194,7 @@ export function prepareI18nPackFiles(externalExtensions: Map<string>, resultingT
|
|||||||
let extensionsPacks: Map<I18nPack> = {};
|
let extensionsPacks: Map<I18nPack> = {};
|
||||||
let errors: any[] = [];
|
let errors: any[] = [];
|
||||||
return through(function (this: ThroughStream, xlf: File) {
|
return through(function (this: ThroughStream, xlf: File) {
|
||||||
let project = path.dirname(xlf.relative);
|
let project = path.basename(path.dirname(xlf.relative));
|
||||||
let resource = path.basename(xlf.relative, '.xlf');
|
let resource = path.basename(xlf.relative, '.xlf');
|
||||||
let contents = xlf.contents.toString();
|
let contents = xlf.contents.toString();
|
||||||
let parsePromise = pseudo ? XLF.parsePseudo(contents) : XLF.parse(contents);
|
let parsePromise = pseudo ? XLF.parsePseudo(contents) : XLF.parse(contents);
|
||||||
|
|||||||
@@ -13,7 +13,8 @@ const flatmap = require("gulp-flatmap");
|
|||||||
const sourcemaps = require("gulp-sourcemaps");
|
const sourcemaps = require("gulp-sourcemaps");
|
||||||
const uglify = require("gulp-uglify");
|
const uglify = require("gulp-uglify");
|
||||||
const composer = require("gulp-uglify/composer");
|
const composer = require("gulp-uglify/composer");
|
||||||
const gulpUtil = require("gulp-util");
|
const fancyLog = require("fancy-log");
|
||||||
|
const ansiColors = require("ansi-colors");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const pump = require("pump");
|
const pump = require("pump");
|
||||||
const uglifyes = require("uglify-es");
|
const uglifyes = require("uglify-es");
|
||||||
@@ -24,7 +25,7 @@ const stats_1 = require("./stats");
|
|||||||
const util = require("./util");
|
const util = require("./util");
|
||||||
const REPO_ROOT_PATH = path.join(__dirname, '../..');
|
const REPO_ROOT_PATH = path.join(__dirname, '../..');
|
||||||
function log(prefix, message) {
|
function log(prefix, message) {
|
||||||
gulpUtil.log(gulpUtil.colors.cyan('[' + prefix + ']'), message);
|
fancyLog(ansiColors.cyan('[' + prefix + ']'), message);
|
||||||
}
|
}
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
function loaderConfig(emptyPaths) {
|
function loaderConfig(emptyPaths) {
|
||||||
@@ -115,7 +116,6 @@ function toBundleStream(src, bundledFileHeader, bundles) {
|
|||||||
function optimizeTask(opts) {
|
function optimizeTask(opts) {
|
||||||
const src = opts.src;
|
const src = opts.src;
|
||||||
const entryPoints = opts.entryPoints;
|
const entryPoints = opts.entryPoints;
|
||||||
const otherSources = opts.otherSources;
|
|
||||||
const resources = opts.resources;
|
const resources = opts.resources;
|
||||||
const loaderConfig = opts.loaderConfig;
|
const loaderConfig = opts.loaderConfig;
|
||||||
const bundledFileHeader = opts.header;
|
const bundledFileHeader = opts.header;
|
||||||
@@ -138,7 +138,7 @@ function optimizeTask(opts) {
|
|||||||
}
|
}
|
||||||
filteredResources.push('!' + resource);
|
filteredResources.push('!' + resource);
|
||||||
});
|
});
|
||||||
gulp.src(filteredResources, { base: `${src}` }).pipe(resourcesStream);
|
gulp.src(filteredResources, { base: `${src}`, allowEmpty: true }).pipe(resourcesStream);
|
||||||
const bundleInfoArray = [];
|
const bundleInfoArray = [];
|
||||||
if (opts.bundleInfo) {
|
if (opts.bundleInfo) {
|
||||||
bundleInfoArray.push(new VinylFile({
|
bundleInfoArray.push(new VinylFile({
|
||||||
@@ -149,20 +149,7 @@ function optimizeTask(opts) {
|
|||||||
}
|
}
|
||||||
es.readArray(bundleInfoArray).pipe(bundleInfoStream);
|
es.readArray(bundleInfoArray).pipe(bundleInfoStream);
|
||||||
});
|
});
|
||||||
const otherSourcesStream = es.through();
|
const result = es.merge(loader(src, bundledFileHeader, bundleLoader), bundlesStream, resourcesStream, bundleInfoStream);
|
||||||
const otherSourcesStreamArr = [];
|
|
||||||
gulp.src(otherSources, { base: `${src}` })
|
|
||||||
.pipe(es.through(function (data) {
|
|
||||||
otherSourcesStreamArr.push(toConcatStream(src, bundledFileHeader, [data], data.relative));
|
|
||||||
}, function () {
|
|
||||||
if (!otherSourcesStreamArr.length) {
|
|
||||||
setTimeout(function () { otherSourcesStream.emit('end'); }, 0);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
es.merge(otherSourcesStreamArr).pipe(otherSourcesStream);
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
const result = es.merge(loader(src, bundledFileHeader, bundleLoader), bundlesStream, otherSourcesStream, resourcesStream, bundleInfoStream);
|
|
||||||
return result
|
return result
|
||||||
.pipe(sourcemaps.write('./', {
|
.pipe(sourcemaps.write('./', {
|
||||||
sourceRoot: undefined,
|
sourceRoot: undefined,
|
||||||
@@ -225,7 +212,12 @@ function minifyTask(src, sourceMapBaseUrl) {
|
|||||||
return cb => {
|
return cb => {
|
||||||
const jsFilter = filter('**/*.js', { restore: true });
|
const jsFilter = filter('**/*.js', { restore: true });
|
||||||
const cssFilter = filter('**/*.css', { restore: true });
|
const cssFilter = filter('**/*.css', { restore: true });
|
||||||
pump(gulp.src([src + '/**', '!' + src + '/**/*.map']), jsFilter, sourcemaps.init({ loadMaps: true }), uglifyWithCopyrights(), jsFilter.restore, cssFilter, minifyCSS({ reduceIdents: false }), cssFilter.restore, sourcemaps.write('./', {
|
pump(gulp.src([src + '/**', '!' + src + '/**/*.map']), jsFilter, sourcemaps.init({ loadMaps: true }), uglifyWithCopyrights(), jsFilter.restore, cssFilter, minifyCSS({ reduceIdents: false }), cssFilter.restore, sourcemaps.mapSources((sourcePath) => {
|
||||||
|
if (sourcePath === 'bootstrap-fork.js') {
|
||||||
|
return 'bootstrap-fork.orig.js';
|
||||||
|
}
|
||||||
|
return sourcePath;
|
||||||
|
}), sourcemaps.write('./', {
|
||||||
sourceMappingURL,
|
sourceMappingURL,
|
||||||
sourceRoot: undefined,
|
sourceRoot: undefined,
|
||||||
includeContent: true,
|
includeContent: true,
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ import * as flatmap from 'gulp-flatmap';
|
|||||||
import * as sourcemaps from 'gulp-sourcemaps';
|
import * as sourcemaps from 'gulp-sourcemaps';
|
||||||
import * as uglify from 'gulp-uglify';
|
import * as uglify from 'gulp-uglify';
|
||||||
import * as composer from 'gulp-uglify/composer';
|
import * as composer from 'gulp-uglify/composer';
|
||||||
import * as gulpUtil from 'gulp-util';
|
import * as fancyLog from 'fancy-log';
|
||||||
|
import * as ansiColors from 'ansi-colors';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as pump from 'pump';
|
import * as pump from 'pump';
|
||||||
import * as sm from 'source-map';
|
import * as sm from 'source-map';
|
||||||
@@ -28,7 +29,7 @@ import * as util from './util';
|
|||||||
const REPO_ROOT_PATH = path.join(__dirname, '../..');
|
const REPO_ROOT_PATH = path.join(__dirname, '../..');
|
||||||
|
|
||||||
function log(prefix: string, message: string): void {
|
function log(prefix: string, message: string): void {
|
||||||
gulpUtil.log(gulpUtil.colors.cyan('[' + prefix + ']'), message);
|
fancyLog(ansiColors.cyan('[' + prefix + ']'), message);
|
||||||
}
|
}
|
||||||
|
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
@@ -143,10 +144,6 @@ export interface IOptimizeTaskOpts {
|
|||||||
* (for AMD files, will get bundled and get Copyright treatment)
|
* (for AMD files, will get bundled and get Copyright treatment)
|
||||||
*/
|
*/
|
||||||
entryPoints: bundle.IEntryPoint[];
|
entryPoints: bundle.IEntryPoint[];
|
||||||
/**
|
|
||||||
* (for non-AMD files that should get Copyright treatment)
|
|
||||||
*/
|
|
||||||
otherSources: string[];
|
|
||||||
/**
|
/**
|
||||||
* (svg, etc.)
|
* (svg, etc.)
|
||||||
*/
|
*/
|
||||||
@@ -177,7 +174,6 @@ export interface IOptimizeTaskOpts {
|
|||||||
export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStream {
|
export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStream {
|
||||||
const src = opts.src;
|
const src = opts.src;
|
||||||
const entryPoints = opts.entryPoints;
|
const entryPoints = opts.entryPoints;
|
||||||
const otherSources = opts.otherSources;
|
|
||||||
const resources = opts.resources;
|
const resources = opts.resources;
|
||||||
const loaderConfig = opts.loaderConfig;
|
const loaderConfig = opts.loaderConfig;
|
||||||
const bundledFileHeader = opts.header;
|
const bundledFileHeader = opts.header;
|
||||||
@@ -202,7 +198,7 @@ export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStr
|
|||||||
}
|
}
|
||||||
filteredResources.push('!' + resource);
|
filteredResources.push('!' + resource);
|
||||||
});
|
});
|
||||||
gulp.src(filteredResources, { base: `${src}` }).pipe(resourcesStream);
|
gulp.src(filteredResources, { base: `${src}`, allowEmpty: true }).pipe(resourcesStream);
|
||||||
|
|
||||||
const bundleInfoArray: VinylFile[] = [];
|
const bundleInfoArray: VinylFile[] = [];
|
||||||
if (opts.bundleInfo) {
|
if (opts.bundleInfo) {
|
||||||
@@ -215,24 +211,9 @@ export function optimizeTask(opts: IOptimizeTaskOpts): () => NodeJS.ReadWriteStr
|
|||||||
es.readArray(bundleInfoArray).pipe(bundleInfoStream);
|
es.readArray(bundleInfoArray).pipe(bundleInfoStream);
|
||||||
});
|
});
|
||||||
|
|
||||||
const otherSourcesStream = es.through();
|
|
||||||
const otherSourcesStreamArr: NodeJS.ReadWriteStream[] = [];
|
|
||||||
|
|
||||||
gulp.src(otherSources, { base: `${src}` })
|
|
||||||
.pipe(es.through(function (data) {
|
|
||||||
otherSourcesStreamArr.push(toConcatStream(src, bundledFileHeader, [data], data.relative));
|
|
||||||
}, function () {
|
|
||||||
if (!otherSourcesStreamArr.length) {
|
|
||||||
setTimeout(function () { otherSourcesStream.emit('end'); }, 0);
|
|
||||||
} else {
|
|
||||||
es.merge(otherSourcesStreamArr).pipe(otherSourcesStream);
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
|
|
||||||
const result = es.merge(
|
const result = es.merge(
|
||||||
loader(src, bundledFileHeader, bundleLoader),
|
loader(src, bundledFileHeader, bundleLoader),
|
||||||
bundlesStream,
|
bundlesStream,
|
||||||
otherSourcesStream,
|
|
||||||
resourcesStream,
|
resourcesStream,
|
||||||
bundleInfoStream
|
bundleInfoStream
|
||||||
);
|
);
|
||||||
@@ -319,6 +300,13 @@ export function minifyTask(src: string, sourceMapBaseUrl?: string): (cb: any) =>
|
|||||||
cssFilter,
|
cssFilter,
|
||||||
minifyCSS({ reduceIdents: false }),
|
minifyCSS({ reduceIdents: false }),
|
||||||
cssFilter.restore,
|
cssFilter.restore,
|
||||||
|
(<any>sourcemaps).mapSources((sourcePath: string) => {
|
||||||
|
if (sourcePath === 'bootstrap-fork.js') {
|
||||||
|
return 'bootstrap-fork.orig.js';
|
||||||
|
}
|
||||||
|
|
||||||
|
return sourcePath;
|
||||||
|
}),
|
||||||
sourcemaps.write('./', {
|
sourcemaps.write('./', {
|
||||||
sourceMappingURL,
|
sourceMappingURL,
|
||||||
sourceRoot: undefined,
|
sourceRoot: undefined,
|
||||||
|
|||||||
@@ -6,7 +6,8 @@
|
|||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const es = require("event-stream");
|
const es = require("event-stream");
|
||||||
const _ = require("underscore");
|
const _ = require("underscore");
|
||||||
const util = require("gulp-util");
|
const fancyLog = require("fancy-log");
|
||||||
|
const ansiColors = require("ansi-colors");
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const allErrors = [];
|
const allErrors = [];
|
||||||
@@ -17,7 +18,7 @@ function onStart() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
startTime = new Date().getTime();
|
startTime = new Date().getTime();
|
||||||
util.log(`Starting ${util.colors.green('compilation')}...`);
|
fancyLog(`Starting ${ansiColors.green('compilation')}...`);
|
||||||
}
|
}
|
||||||
function onEnd() {
|
function onEnd() {
|
||||||
if (--count > 0) {
|
if (--count > 0) {
|
||||||
@@ -38,7 +39,7 @@ function log() {
|
|||||||
errors.map(err => {
|
errors.map(err => {
|
||||||
if (!seen.has(err)) {
|
if (!seen.has(err)) {
|
||||||
seen.add(err);
|
seen.add(err);
|
||||||
util.log(`${util.colors.red('Error')}: ${err}`);
|
fancyLog(`${ansiColors.red('Error')}: ${err}`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const regex = /^([^(]+)\((\d+),(\d+)\): (.*)$/;
|
const regex = /^([^(]+)\((\d+),(\d+)\): (.*)$/;
|
||||||
@@ -53,7 +54,7 @@ function log() {
|
|||||||
catch (err) {
|
catch (err) {
|
||||||
//noop
|
//noop
|
||||||
}
|
}
|
||||||
util.log(`Finished ${util.colors.green('compilation')} with ${errors.length} errors after ${util.colors.magenta((new Date().getTime() - startTime) + ' ms')}`);
|
fancyLog(`Finished ${ansiColors.green('compilation')} with ${errors.length} errors after ${ansiColors.magenta((new Date().getTime() - startTime) + ' ms')}`);
|
||||||
}
|
}
|
||||||
function createReporter() {
|
function createReporter() {
|
||||||
const errors = [];
|
const errors = [];
|
||||||
|
|||||||
@@ -7,7 +7,8 @@
|
|||||||
|
|
||||||
import * as es from 'event-stream';
|
import * as es from 'event-stream';
|
||||||
import * as _ from 'underscore';
|
import * as _ from 'underscore';
|
||||||
import * as util from 'gulp-util';
|
import * as fancyLog from 'fancy-log';
|
||||||
|
import * as ansiColors from 'ansi-colors';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
|
|
||||||
@@ -21,7 +22,7 @@ function onStart(): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
startTime = new Date().getTime();
|
startTime = new Date().getTime();
|
||||||
util.log(`Starting ${util.colors.green('compilation')}...`);
|
fancyLog(`Starting ${ansiColors.green('compilation')}...`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function onEnd(): void {
|
function onEnd(): void {
|
||||||
@@ -47,7 +48,7 @@ function log(): void {
|
|||||||
errors.map(err => {
|
errors.map(err => {
|
||||||
if (!seen.has(err)) {
|
if (!seen.has(err)) {
|
||||||
seen.add(err);
|
seen.add(err);
|
||||||
util.log(`${util.colors.red('Error')}: ${err}`);
|
fancyLog(`${ansiColors.red('Error')}: ${err}`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -65,7 +66,7 @@ function log(): void {
|
|||||||
//noop
|
//noop
|
||||||
}
|
}
|
||||||
|
|
||||||
util.log(`Finished ${util.colors.green('compilation')} with ${errors.length} errors after ${util.colors.magenta((new Date().getTime() - startTime!) + ' ms')}`);
|
fancyLog(`Finished ${ansiColors.green('compilation')} with ${errors.length} errors after ${ansiColors.magenta((new Date().getTime() - startTime!) + ' ms')}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IReporter {
|
export interface IReporter {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ function writeFile(filePath, contents) {
|
|||||||
fs.writeFileSync(filePath, contents);
|
fs.writeFileSync(filePath, contents);
|
||||||
}
|
}
|
||||||
function extractEditor(options) {
|
function extractEditor(options) {
|
||||||
const tsConfig = JSON.parse(fs.readFileSync(path.join(options.sourcesRoot, 'tsconfig.json')).toString());
|
const tsConfig = JSON.parse(fs.readFileSync(path.join(options.sourcesRoot, 'tsconfig.monaco.json')).toString());
|
||||||
let compilerOptions;
|
let compilerOptions;
|
||||||
if (tsConfig.extends) {
|
if (tsConfig.extends) {
|
||||||
compilerOptions = Object.assign({}, require(path.join(options.sourcesRoot, tsConfig.extends)).compilerOptions, tsConfig.compilerOptions);
|
compilerOptions = Object.assign({}, require(path.join(options.sourcesRoot, tsConfig.extends)).compilerOptions, tsConfig.compilerOptions);
|
||||||
@@ -36,13 +36,11 @@ function extractEditor(options) {
|
|||||||
compilerOptions = tsConfig.compilerOptions;
|
compilerOptions = tsConfig.compilerOptions;
|
||||||
}
|
}
|
||||||
tsConfig.compilerOptions = compilerOptions;
|
tsConfig.compilerOptions = compilerOptions;
|
||||||
|
compilerOptions.noEmit = false;
|
||||||
compilerOptions.noUnusedLocals = false;
|
compilerOptions.noUnusedLocals = false;
|
||||||
compilerOptions.preserveConstEnums = false;
|
compilerOptions.preserveConstEnums = false;
|
||||||
compilerOptions.declaration = false;
|
compilerOptions.declaration = false;
|
||||||
compilerOptions.moduleResolution = ts.ModuleResolutionKind.Classic;
|
compilerOptions.moduleResolution = ts.ModuleResolutionKind.Classic;
|
||||||
delete compilerOptions.types;
|
|
||||||
delete tsConfig.extends;
|
|
||||||
tsConfig.exclude = [];
|
|
||||||
options.compilerOptions = compilerOptions;
|
options.compilerOptions = compilerOptions;
|
||||||
let result = tss.shake(options);
|
let result = tss.shake(options);
|
||||||
for (let fileName in result) {
|
for (let fileName in result) {
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ function writeFile(filePath: string, contents: Buffer | string): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function extractEditor(options: tss.ITreeShakingOptions & { destRoot: string }): void {
|
export function extractEditor(options: tss.ITreeShakingOptions & { destRoot: string }): void {
|
||||||
const tsConfig = JSON.parse(fs.readFileSync(path.join(options.sourcesRoot, 'tsconfig.json')).toString());
|
const tsConfig = JSON.parse(fs.readFileSync(path.join(options.sourcesRoot, 'tsconfig.monaco.json')).toString());
|
||||||
let compilerOptions: { [key: string]: any };
|
let compilerOptions: { [key: string]: any };
|
||||||
if (tsConfig.extends) {
|
if (tsConfig.extends) {
|
||||||
compilerOptions = Object.assign({}, require(path.join(options.sourcesRoot, tsConfig.extends)).compilerOptions, tsConfig.compilerOptions);
|
compilerOptions = Object.assign({}, require(path.join(options.sourcesRoot, tsConfig.extends)).compilerOptions, tsConfig.compilerOptions);
|
||||||
@@ -40,14 +40,12 @@ export function extractEditor(options: tss.ITreeShakingOptions & { destRoot: str
|
|||||||
}
|
}
|
||||||
tsConfig.compilerOptions = compilerOptions;
|
tsConfig.compilerOptions = compilerOptions;
|
||||||
|
|
||||||
|
compilerOptions.noEmit = false;
|
||||||
compilerOptions.noUnusedLocals = false;
|
compilerOptions.noUnusedLocals = false;
|
||||||
compilerOptions.preserveConstEnums = false;
|
compilerOptions.preserveConstEnums = false;
|
||||||
compilerOptions.declaration = false;
|
compilerOptions.declaration = false;
|
||||||
compilerOptions.moduleResolution = ts.ModuleResolutionKind.Classic;
|
compilerOptions.moduleResolution = ts.ModuleResolutionKind.Classic;
|
||||||
|
|
||||||
delete compilerOptions.types;
|
|
||||||
delete tsConfig.extends;
|
|
||||||
tsConfig.exclude = [];
|
|
||||||
|
|
||||||
options.compilerOptions = compilerOptions;
|
options.compilerOptions = compilerOptions;
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const es = require("event-stream");
|
const es = require("event-stream");
|
||||||
const util = require("gulp-util");
|
const fancyLog = require("fancy-log");
|
||||||
|
const ansiColors = require("ansi-colors");
|
||||||
const appInsights = require("applicationinsights");
|
const appInsights = require("applicationinsights");
|
||||||
class Entry {
|
class Entry {
|
||||||
constructor(name, totalCount, totalSize) {
|
constructor(name, totalCount, totalSize) {
|
||||||
@@ -24,13 +25,13 @@ class Entry {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (this.totalCount === 1) {
|
if (this.totalCount === 1) {
|
||||||
return `Stats for '${util.colors.grey(this.name)}': ${Math.round(this.totalSize / 1204)}KB`;
|
return `Stats for '${ansiColors.grey(this.name)}': ${Math.round(this.totalSize / 1204)}KB`;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const count = this.totalCount < 100
|
const count = this.totalCount < 100
|
||||||
? util.colors.green(this.totalCount.toString())
|
? ansiColors.green(this.totalCount.toString())
|
||||||
: util.colors.red(this.totalCount.toString());
|
: ansiColors.red(this.totalCount.toString());
|
||||||
return `Stats for '${util.colors.grey(this.name)}': ${count} files, ${Math.round(this.totalSize / 1204)}KB`;
|
return `Stats for '${ansiColors.grey(this.name)}': ${count} files, ${Math.round(this.totalSize / 1204)}KB`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -57,13 +58,13 @@ function createStatsStream(group, log) {
|
|||||||
}, function () {
|
}, function () {
|
||||||
if (log) {
|
if (log) {
|
||||||
if (entry.totalCount === 1) {
|
if (entry.totalCount === 1) {
|
||||||
util.log(`Stats for '${util.colors.grey(entry.name)}': ${Math.round(entry.totalSize / 1204)}KB`);
|
fancyLog(`Stats for '${ansiColors.grey(entry.name)}': ${Math.round(entry.totalSize / 1204)}KB`);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const count = entry.totalCount < 100
|
const count = entry.totalCount < 100
|
||||||
? util.colors.green(entry.totalCount.toString())
|
? ansiColors.green(entry.totalCount.toString())
|
||||||
: util.colors.red(entry.totalCount.toString());
|
: ansiColors.red(entry.totalCount.toString());
|
||||||
util.log(`Stats for '${util.colors.grey(entry.name)}': ${count} files, ${Math.round(entry.totalSize / 1204)}KB`);
|
fancyLog(`Stats for '${ansiColors.grey(entry.name)}': ${count} files, ${Math.round(entry.totalSize / 1204)}KB`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.emit('end');
|
this.emit('end');
|
||||||
|
|||||||
@@ -6,7 +6,8 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
import * as es from 'event-stream';
|
import * as es from 'event-stream';
|
||||||
import * as util from 'gulp-util';
|
import * as fancyLog from 'fancy-log';
|
||||||
|
import * as ansiColors from 'ansi-colors';
|
||||||
import * as File from 'vinyl';
|
import * as File from 'vinyl';
|
||||||
import * as appInsights from 'applicationinsights';
|
import * as appInsights from 'applicationinsights';
|
||||||
|
|
||||||
@@ -22,14 +23,14 @@ class Entry {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (this.totalCount === 1) {
|
if (this.totalCount === 1) {
|
||||||
return `Stats for '${util.colors.grey(this.name)}': ${Math.round(this.totalSize / 1204)}KB`;
|
return `Stats for '${ansiColors.grey(this.name)}': ${Math.round(this.totalSize / 1204)}KB`;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
const count = this.totalCount < 100
|
const count = this.totalCount < 100
|
||||||
? util.colors.green(this.totalCount.toString())
|
? ansiColors.green(this.totalCount.toString())
|
||||||
: util.colors.red(this.totalCount.toString());
|
: ansiColors.red(this.totalCount.toString());
|
||||||
|
|
||||||
return `Stats for '${util.colors.grey(this.name)}': ${count} files, ${Math.round(this.totalSize / 1204)}KB`;
|
return `Stats for '${ansiColors.grey(this.name)}': ${count} files, ${Math.round(this.totalSize / 1204)}KB`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -58,14 +59,14 @@ export function createStatsStream(group: string, log?: boolean): es.ThroughStrea
|
|||||||
}, function () {
|
}, function () {
|
||||||
if (log) {
|
if (log) {
|
||||||
if (entry.totalCount === 1) {
|
if (entry.totalCount === 1) {
|
||||||
util.log(`Stats for '${util.colors.grey(entry.name)}': ${Math.round(entry.totalSize / 1204)}KB`);
|
fancyLog(`Stats for '${ansiColors.grey(entry.name)}': ${Math.round(entry.totalSize / 1204)}KB`);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
const count = entry.totalCount < 100
|
const count = entry.totalCount < 100
|
||||||
? util.colors.green(entry.totalCount.toString())
|
? ansiColors.green(entry.totalCount.toString())
|
||||||
: util.colors.red(entry.totalCount.toString());
|
: ansiColors.red(entry.totalCount.toString());
|
||||||
|
|
||||||
util.log(`Stats for '${util.colors.grey(entry.name)}': ${count} files, ${Math.round(entry.totalSize / 1204)}KB`);
|
fancyLog(`Stats for '${ansiColors.grey(entry.name)}': ${count} files, ${Math.round(entry.totalSize / 1204)}KB`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
96
build/lib/task.js
Normal file
96
build/lib/task.js
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* 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 });
|
||||||
|
const fancyLog = require("fancy-log");
|
||||||
|
const ansiColors = require("ansi-colors");
|
||||||
|
function _isPromise(p) {
|
||||||
|
if (typeof p.then === 'function') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
function _renderTime(time) {
|
||||||
|
return `${Math.round(time)} ms`;
|
||||||
|
}
|
||||||
|
async function _execute(task) {
|
||||||
|
const name = task.taskName || task.displayName || `<anonymous>`;
|
||||||
|
if (!task._tasks) {
|
||||||
|
fancyLog('Starting', ansiColors.cyan(name), '...');
|
||||||
|
}
|
||||||
|
const startTime = process.hrtime();
|
||||||
|
await _doExecute(task);
|
||||||
|
const elapsedArr = process.hrtime(startTime);
|
||||||
|
const elapsedNanoseconds = (elapsedArr[0] * 1e9 + elapsedArr[1]);
|
||||||
|
if (!task._tasks) {
|
||||||
|
fancyLog(`Finished`, ansiColors.cyan(name), 'after', ansiColors.magenta(_renderTime(elapsedNanoseconds / 1e6)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function _doExecute(task) {
|
||||||
|
// Always invoke as if it were a callback task
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
if (task.length === 1) {
|
||||||
|
// this is a calback task
|
||||||
|
task((err) => {
|
||||||
|
if (err) {
|
||||||
|
return reject(err);
|
||||||
|
}
|
||||||
|
resolve();
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const taskResult = task();
|
||||||
|
if (typeof taskResult === 'undefined') {
|
||||||
|
// this is a sync task
|
||||||
|
resolve();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (_isPromise(taskResult)) {
|
||||||
|
// this is a promise returning task
|
||||||
|
taskResult.then(resolve, reject);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// this is a stream returning task
|
||||||
|
taskResult.on('end', _ => resolve());
|
||||||
|
taskResult.on('error', err => reject(err));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function series(...tasks) {
|
||||||
|
const result = async () => {
|
||||||
|
for (let i = 0; i < tasks.length; i++) {
|
||||||
|
await _execute(tasks[i]);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
result._tasks = tasks;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
exports.series = series;
|
||||||
|
function parallel(...tasks) {
|
||||||
|
const result = async () => {
|
||||||
|
await Promise.all(tasks.map(t => _execute(t)));
|
||||||
|
};
|
||||||
|
result._tasks = tasks;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
exports.parallel = parallel;
|
||||||
|
function define(name, task) {
|
||||||
|
if (task._tasks) {
|
||||||
|
// This is a composite task
|
||||||
|
const lastTask = task._tasks[task._tasks.length - 1];
|
||||||
|
if (lastTask._tasks || lastTask.taskName) {
|
||||||
|
// This is a composite task without a real task function
|
||||||
|
// => generate a fake task function
|
||||||
|
return define(name, series(task, () => Promise.resolve()));
|
||||||
|
}
|
||||||
|
lastTask.taskName = name;
|
||||||
|
task.displayName = name;
|
||||||
|
return task;
|
||||||
|
}
|
||||||
|
// This is a simple task
|
||||||
|
task.taskName = name;
|
||||||
|
task.displayName = name;
|
||||||
|
return task;
|
||||||
|
}
|
||||||
|
exports.define = define;
|
||||||
125
build/lib/task.ts
Normal file
125
build/lib/task.ts
Normal file
@@ -0,0 +1,125 @@
|
|||||||
|
/*---------------------------------------------------------------------------------------------
|
||||||
|
* 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 fancyLog from 'fancy-log';
|
||||||
|
import * as ansiColors from 'ansi-colors';
|
||||||
|
|
||||||
|
export interface BaseTask {
|
||||||
|
displayName?: string;
|
||||||
|
taskName?: string;
|
||||||
|
_tasks?: Task[];
|
||||||
|
}
|
||||||
|
export interface PromiseTask extends BaseTask {
|
||||||
|
(): Promise<void>;
|
||||||
|
}
|
||||||
|
export interface StreamTask extends BaseTask {
|
||||||
|
(): NodeJS.ReadWriteStream;
|
||||||
|
}
|
||||||
|
export interface CallbackTask extends BaseTask {
|
||||||
|
(cb?: (err?: any) => void): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type Task = PromiseTask | StreamTask | CallbackTask;
|
||||||
|
|
||||||
|
function _isPromise(p: Promise<void> | NodeJS.ReadWriteStream): p is Promise<void> {
|
||||||
|
if (typeof (<any>p).then === 'function') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function _renderTime(time: number): string {
|
||||||
|
return `${Math.round(time)} ms`;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function _execute(task: Task): Promise<void> {
|
||||||
|
const name = task.taskName || task.displayName || `<anonymous>`;
|
||||||
|
if (!task._tasks) {
|
||||||
|
fancyLog('Starting', ansiColors.cyan(name), '...');
|
||||||
|
}
|
||||||
|
const startTime = process.hrtime();
|
||||||
|
await _doExecute(task);
|
||||||
|
const elapsedArr = process.hrtime(startTime);
|
||||||
|
const elapsedNanoseconds = (elapsedArr[0] * 1e9 + elapsedArr[1]);
|
||||||
|
if (!task._tasks) {
|
||||||
|
fancyLog(`Finished`, ansiColors.cyan(name), 'after', ansiColors.magenta(_renderTime(elapsedNanoseconds / 1e6)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function _doExecute(task: Task): Promise<void> {
|
||||||
|
// Always invoke as if it were a callback task
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
if (task.length === 1) {
|
||||||
|
// this is a calback task
|
||||||
|
task((err) => {
|
||||||
|
if (err) {
|
||||||
|
return reject(err);
|
||||||
|
}
|
||||||
|
resolve();
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const taskResult = task();
|
||||||
|
|
||||||
|
if (typeof taskResult === 'undefined') {
|
||||||
|
// this is a sync task
|
||||||
|
resolve();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_isPromise(taskResult)) {
|
||||||
|
// this is a promise returning task
|
||||||
|
taskResult.then(resolve, reject);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// this is a stream returning task
|
||||||
|
taskResult.on('end', _ => resolve());
|
||||||
|
taskResult.on('error', err => reject(err));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function series(...tasks: Task[]): PromiseTask {
|
||||||
|
const result = async () => {
|
||||||
|
for (let i = 0; i < tasks.length; i++) {
|
||||||
|
await _execute(tasks[i]);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
result._tasks = tasks;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function parallel(...tasks: Task[]): PromiseTask {
|
||||||
|
const result = async () => {
|
||||||
|
await Promise.all(tasks.map(t => _execute(t)));
|
||||||
|
};
|
||||||
|
result._tasks = tasks;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function define(name: string, task: Task): Task {
|
||||||
|
if (task._tasks) {
|
||||||
|
// This is a composite task
|
||||||
|
const lastTask = task._tasks[task._tasks.length - 1];
|
||||||
|
|
||||||
|
if (lastTask._tasks || lastTask.taskName) {
|
||||||
|
// This is a composite task without a real task function
|
||||||
|
// => generate a fake task function
|
||||||
|
return define(name, series(task, () => Promise.resolve()));
|
||||||
|
}
|
||||||
|
|
||||||
|
lastTask.taskName = name;
|
||||||
|
task.displayName = name;
|
||||||
|
return task;
|
||||||
|
}
|
||||||
|
|
||||||
|
// This is a simple task
|
||||||
|
task.taskName = name;
|
||||||
|
task.displayName = name;
|
||||||
|
return task;
|
||||||
|
}
|
||||||
@@ -27,13 +27,13 @@ suite('XLF Parser Tests', () => {
|
|||||||
});
|
});
|
||||||
test('JSON file source path to Transifex resource match', () => {
|
test('JSON file source path to Transifex resource match', () => {
|
||||||
const editorProject = 'vscode-editor', workbenchProject = 'vscode-workbench';
|
const editorProject = 'vscode-editor', workbenchProject = 'vscode-workbench';
|
||||||
const platform = { name: 'vs/platform', project: editorProject }, editorContrib = { name: 'vs/editor/contrib', project: editorProject }, editor = { name: 'vs/editor', project: editorProject }, base = { name: 'vs/base', project: editorProject }, code = { name: 'vs/code', project: workbenchProject }, workbenchParts = { name: 'vs/workbench/parts/html', project: workbenchProject }, workbenchServices = { name: 'vs/workbench/services/files', project: workbenchProject }, workbench = { name: 'vs/workbench', project: workbenchProject };
|
const platform = { name: 'vs/platform', project: editorProject }, editorContrib = { name: 'vs/editor/contrib', project: editorProject }, editor = { name: 'vs/editor', project: editorProject }, base = { name: 'vs/base', project: editorProject }, code = { name: 'vs/code', project: workbenchProject }, workbenchParts = { name: 'vs/workbench/contrib/html', project: workbenchProject }, workbenchServices = { name: 'vs/workbench/services/files', project: workbenchProject }, workbench = { name: 'vs/workbench', project: workbenchProject };
|
||||||
assert.deepEqual(i18n.getResource('vs/platform/actions/browser/menusExtensionPoint'), platform);
|
assert.deepEqual(i18n.getResource('vs/platform/actions/browser/menusExtensionPoint'), platform);
|
||||||
assert.deepEqual(i18n.getResource('vs/editor/contrib/clipboard/browser/clipboard'), editorContrib);
|
assert.deepEqual(i18n.getResource('vs/editor/contrib/clipboard/browser/clipboard'), editorContrib);
|
||||||
assert.deepEqual(i18n.getResource('vs/editor/common/modes/modesRegistry'), editor);
|
assert.deepEqual(i18n.getResource('vs/editor/common/modes/modesRegistry'), editor);
|
||||||
assert.deepEqual(i18n.getResource('vs/base/common/errorMessage'), base);
|
assert.deepEqual(i18n.getResource('vs/base/common/errorMessage'), base);
|
||||||
assert.deepEqual(i18n.getResource('vs/code/electron-main/window'), code);
|
assert.deepEqual(i18n.getResource('vs/code/electron-main/window'), code);
|
||||||
assert.deepEqual(i18n.getResource('vs/workbench/parts/html/browser/webview'), workbenchParts);
|
assert.deepEqual(i18n.getResource('vs/workbench/contrib/html/browser/webview'), workbenchParts);
|
||||||
assert.deepEqual(i18n.getResource('vs/workbench/services/files/node/fileService'), workbenchServices);
|
assert.deepEqual(i18n.getResource('vs/workbench/services/files/node/fileService'), workbenchServices);
|
||||||
assert.deepEqual(i18n.getResource('vs/workbench/browser/parts/panel/panelActions'), workbench);
|
assert.deepEqual(i18n.getResource('vs/workbench/browser/parts/panel/panelActions'), workbench);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ suite('XLF Parser Tests', () => {
|
|||||||
editor = { name: 'vs/editor', project: editorProject },
|
editor = { name: 'vs/editor', project: editorProject },
|
||||||
base = { name: 'vs/base', project: editorProject },
|
base = { name: 'vs/base', project: editorProject },
|
||||||
code = { name: 'vs/code', project: workbenchProject },
|
code = { name: 'vs/code', project: workbenchProject },
|
||||||
workbenchParts = { name: 'vs/workbench/parts/html', project: workbenchProject },
|
workbenchParts = { name: 'vs/workbench/contrib/html', project: workbenchProject },
|
||||||
workbenchServices = { name: 'vs/workbench/services/files', project: workbenchProject },
|
workbenchServices = { name: 'vs/workbench/services/files', project: workbenchProject },
|
||||||
workbench = { name: 'vs/workbench', project: workbenchProject};
|
workbench = { name: 'vs/workbench', project: workbenchProject};
|
||||||
|
|
||||||
@@ -47,7 +47,7 @@ suite('XLF Parser Tests', () => {
|
|||||||
assert.deepEqual(i18n.getResource('vs/editor/common/modes/modesRegistry'), editor);
|
assert.deepEqual(i18n.getResource('vs/editor/common/modes/modesRegistry'), editor);
|
||||||
assert.deepEqual(i18n.getResource('vs/base/common/errorMessage'), base);
|
assert.deepEqual(i18n.getResource('vs/base/common/errorMessage'), base);
|
||||||
assert.deepEqual(i18n.getResource('vs/code/electron-main/window'), code);
|
assert.deepEqual(i18n.getResource('vs/code/electron-main/window'), code);
|
||||||
assert.deepEqual(i18n.getResource('vs/workbench/parts/html/browser/webview'), workbenchParts);
|
assert.deepEqual(i18n.getResource('vs/workbench/contrib/html/browser/webview'), workbenchParts);
|
||||||
assert.deepEqual(i18n.getResource('vs/workbench/services/files/node/fileService'), workbenchServices);
|
assert.deepEqual(i18n.getResource('vs/workbench/services/files/node/fileService'), workbenchServices);
|
||||||
assert.deepEqual(i18n.getResource('vs/workbench/browser/parts/panel/panelActions'), workbench);
|
assert.deepEqual(i18n.getResource('vs/workbench/browser/parts/panel/panelActions'), workbench);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class TranslationRemindRuleWalker extends Lint.RuleWalker {
|
|||||||
visitImportLikeDeclaration(node) {
|
visitImportLikeDeclaration(node) {
|
||||||
const currentFile = node.getSourceFile().fileName;
|
const currentFile = node.getSourceFile().fileName;
|
||||||
const matchService = currentFile.match(/vs\/workbench\/services\/\w+/);
|
const matchService = currentFile.match(/vs\/workbench\/services\/\w+/);
|
||||||
const matchPart = currentFile.match(/vs\/workbench\/parts\/\w+/);
|
const matchPart = currentFile.match(/vs\/workbench\/contrib\/\w+/);
|
||||||
if (!matchService && !matchPart) {
|
if (!matchService && !matchPart) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ class TranslationRemindRuleWalker extends Lint.RuleWalker {
|
|||||||
private visitImportLikeDeclaration(node: ts.ImportDeclaration | ts.ImportEqualsDeclaration) {
|
private visitImportLikeDeclaration(node: ts.ImportDeclaration | ts.ImportEqualsDeclaration) {
|
||||||
const currentFile = node.getSourceFile().fileName;
|
const currentFile = node.getSourceFile().fileName;
|
||||||
const matchService = currentFile.match(/vs\/workbench\/services\/\w+/);
|
const matchService = currentFile.match(/vs\/workbench\/services\/\w+/);
|
||||||
const matchPart = currentFile.match(/vs\/workbench\/parts\/\w+/);
|
const matchPart = currentFile.match(/vs\/workbench\/contrib\/\w+/);
|
||||||
if (!matchService && !matchPart) {
|
if (!matchService && !matchPart) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ const fs = require("fs");
|
|||||||
const _rimraf = require("rimraf");
|
const _rimraf = require("rimraf");
|
||||||
const git = require("./git");
|
const git = require("./git");
|
||||||
const VinylFile = require("vinyl");
|
const VinylFile = require("vinyl");
|
||||||
|
const download_1 = require("../download/download");
|
||||||
|
const REPO_ROOT = path.join(__dirname, '../../');
|
||||||
const NoCancellationToken = { isCancellationRequested: () => false };
|
const NoCancellationToken = { isCancellationRequested: () => false };
|
||||||
function incremental(streamProvider, initial, supportsCancellation) {
|
function incremental(streamProvider, initial, supportsCancellation) {
|
||||||
const input = es.through();
|
const input = es.through();
|
||||||
@@ -180,7 +182,8 @@ function rimraf(dir) {
|
|||||||
return cb(err);
|
return cb(err);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
return cb => retry(cb);
|
retry.taskName = `clean-${path.basename(dir)}`;
|
||||||
|
return retry;
|
||||||
}
|
}
|
||||||
exports.rimraf = rimraf;
|
exports.rimraf = rimraf;
|
||||||
function getVersion(root) {
|
function getVersion(root) {
|
||||||
@@ -220,3 +223,38 @@ 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);
|
||||||
}
|
}
|
||||||
exports.versionStringToNumber = versionStringToNumber;
|
exports.versionStringToNumber = versionStringToNumber;
|
||||||
|
function download(requestOptions) {
|
||||||
|
const result = es.through();
|
||||||
|
const filename = path.join(REPO_ROOT, `.build/tmp-${Date.now()}-${path.posix.basename(requestOptions.path)}`);
|
||||||
|
const opts = {
|
||||||
|
requestOptions: requestOptions,
|
||||||
|
destinationPath: filename
|
||||||
|
};
|
||||||
|
download_1.downloadInExternalProcess(opts).then(() => {
|
||||||
|
fs.stat(filename, (err, stat) => {
|
||||||
|
if (err) {
|
||||||
|
result.emit('error', err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
fs.readFile(filename, (err, data) => {
|
||||||
|
if (err) {
|
||||||
|
result.emit('error', err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
fs.unlink(filename, () => {
|
||||||
|
result.emit('data', new VinylFile({
|
||||||
|
path: path.normalize(requestOptions.path),
|
||||||
|
stat: stat,
|
||||||
|
base: path.normalize(requestOptions.path),
|
||||||
|
contents: data
|
||||||
|
}));
|
||||||
|
result.emit('end');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}, (err) => {
|
||||||
|
result.emit('error', err);
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
exports.download = download;
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ import * as git from './git';
|
|||||||
import * as VinylFile from 'vinyl';
|
import * as VinylFile from 'vinyl';
|
||||||
import { ThroughStream } from 'through';
|
import { ThroughStream } from 'through';
|
||||||
import * as sm from 'source-map';
|
import * as sm from 'source-map';
|
||||||
|
import { IDownloadOptions, downloadInExternalProcess, IDownloadRequestOptions } from '../download/download';
|
||||||
|
|
||||||
|
const REPO_ROOT = path.join(__dirname, '../../');
|
||||||
|
|
||||||
export interface ICancellationToken {
|
export interface ICancellationToken {
|
||||||
isCancellationRequested(): boolean;
|
isCancellationRequested(): boolean;
|
||||||
@@ -233,8 +236,8 @@ export function rimraf(dir: string): (cb: any) => void {
|
|||||||
return cb(err);
|
return cb(err);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
retry.taskName = `clean-${path.basename(dir)}`;
|
||||||
return cb => retry(cb);
|
return retry;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getVersion(root: string): string | undefined {
|
export function getVersion(root: string): string | undefined {
|
||||||
@@ -280,3 +283,38 @@ export function versionStringToNumber(versionStr: string) {
|
|||||||
|
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function download(requestOptions: IDownloadRequestOptions): NodeJS.ReadWriteStream {
|
||||||
|
const result = es.through();
|
||||||
|
const filename = path.join(REPO_ROOT, `.build/tmp-${Date.now()}-${path.posix.basename(requestOptions.path)}`);
|
||||||
|
const opts: IDownloadOptions = {
|
||||||
|
requestOptions: requestOptions,
|
||||||
|
destinationPath: filename
|
||||||
|
};
|
||||||
|
downloadInExternalProcess(opts).then(() => {
|
||||||
|
fs.stat(filename, (err, stat) => {
|
||||||
|
if (err) {
|
||||||
|
result.emit('error', err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
fs.readFile(filename, (err, data) => {
|
||||||
|
if (err) {
|
||||||
|
result.emit('error', err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
fs.unlink(filename, () => {
|
||||||
|
result.emit('data', new VinylFile({
|
||||||
|
path: path.normalize(requestOptions.path),
|
||||||
|
stat: stat,
|
||||||
|
base: path.normalize(requestOptions.path),
|
||||||
|
contents: data
|
||||||
|
}));
|
||||||
|
result.emit('end');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}, (err) => {
|
||||||
|
result.emit('error', err);
|
||||||
|
});
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|||||||
@@ -7,6 +7,31 @@ herein, whether by implication, estoppel or otherwise.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
%% nodejs path library (https://github.com/nodejs/node/tree/43dd49c9782848c25e5b03448c8a0f923f13c158)
|
||||||
|
=========================================
|
||||||
|
Copyright Joyent, Inc. and other Node contributors.
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
copy of this software and associated documentation files (the
|
||||||
|
"Software"), to deal in the Software without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||||
|
persons to whom the Software is furnished to do so, subject to the
|
||||||
|
following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included
|
||||||
|
in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
|
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
||||||
|
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||||
|
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||||
|
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||||
|
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
=========================================
|
||||||
|
END OF nodejs path library NOTICES AND INFORMATION
|
||||||
|
|
||||||
|
|
||||||
%% promise-polyfill version 8.1.0 (https://github.com/taylorhakes/promise-polyfill)
|
%% promise-polyfill version 8.1.0 (https://github.com/taylorhakes/promise-polyfill)
|
||||||
=========================================
|
=========================================
|
||||||
|
|||||||
@@ -7,14 +7,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const ts = require("typescript");
|
const ts = require("typescript");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const util = require("gulp-util");
|
const fancyLog = require("fancy-log");
|
||||||
|
const ansiColors = require("ansi-colors");
|
||||||
const dtsv = '2';
|
const dtsv = '2';
|
||||||
const tsfmt = require('../../tsfmt.json');
|
const tsfmt = require('../../tsfmt.json');
|
||||||
const SRC = path.join(__dirname, '../../src');
|
const SRC = path.join(__dirname, '../../src');
|
||||||
exports.RECIPE_PATH = path.join(__dirname, './monaco.d.ts.recipe');
|
exports.RECIPE_PATH = path.join(__dirname, './monaco.d.ts.recipe');
|
||||||
const DECLARATION_PATH = path.join(__dirname, '../../src/vs/monaco.d.ts');
|
const DECLARATION_PATH = path.join(__dirname, '../../src/vs/monaco.d.ts');
|
||||||
function logErr(message, ...rest) {
|
function logErr(message, ...rest) {
|
||||||
util.log(util.colors.yellow(`[monaco.d.ts]`), message, ...rest);
|
fancyLog(ansiColors.yellow(`[monaco.d.ts]`), message, ...rest);
|
||||||
}
|
}
|
||||||
function isDeclaration(a) {
|
function isDeclaration(a) {
|
||||||
return (a.kind === ts.SyntaxKind.InterfaceDeclaration
|
return (a.kind === ts.SyntaxKind.InterfaceDeclaration
|
||||||
|
|||||||
@@ -6,7 +6,8 @@
|
|||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as ts from 'typescript';
|
import * as ts from 'typescript';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as util from 'gulp-util';
|
import * as fancyLog from 'fancy-log';
|
||||||
|
import * as ansiColors from 'ansi-colors';
|
||||||
|
|
||||||
const dtsv = '2';
|
const dtsv = '2';
|
||||||
|
|
||||||
@@ -17,7 +18,7 @@ export const RECIPE_PATH = path.join(__dirname, './monaco.d.ts.recipe');
|
|||||||
const DECLARATION_PATH = path.join(__dirname, '../../src/vs/monaco.d.ts');
|
const DECLARATION_PATH = path.join(__dirname, '../../src/vs/monaco.d.ts');
|
||||||
|
|
||||||
function logErr(message: any, ...rest: any[]): void {
|
function logErr(message: any, ...rest: any[]): void {
|
||||||
util.log(util.colors.yellow(`[monaco.d.ts]`), message, ...rest);
|
fancyLog(ansiColors.yellow(`[monaco.d.ts]`), message, ...rest);
|
||||||
}
|
}
|
||||||
|
|
||||||
type SourceFileGetter = (moduleId: string) => ts.SourceFile | null;
|
type SourceFileGetter = (moduleId: string) => ts.SourceFile | null;
|
||||||
|
|||||||
@@ -10,8 +10,10 @@ import { CountBadge } from './vs/base/browser/ui/countBadge/countBadge';
|
|||||||
import { SimpleWorkerClient, create as create1 } from './vs/base/common/worker/simpleWorker';
|
import { SimpleWorkerClient, create as create1 } from './vs/base/common/worker/simpleWorker';
|
||||||
import { create as create2 } from './vs/editor/common/services/editorSimpleWorker';
|
import { create as create2 } from './vs/editor/common/services/editorSimpleWorker';
|
||||||
import { QuickOpenWidget } from './vs/base/parts/quickopen/browser/quickOpenWidget';
|
import { QuickOpenWidget } from './vs/base/parts/quickopen/browser/quickOpenWidget';
|
||||||
|
import { WorkbenchAsyncDataTree } from './vs/platform/list/browser/listService';
|
||||||
import { SyncDescriptor0, SyncDescriptor1, SyncDescriptor2, SyncDescriptor3, SyncDescriptor4, SyncDescriptor5, SyncDescriptor6, SyncDescriptor7, SyncDescriptor8 } from './vs/platform/instantiation/common/descriptors';
|
import { SyncDescriptor0, SyncDescriptor1, SyncDescriptor2, SyncDescriptor3, SyncDescriptor4, SyncDescriptor5, SyncDescriptor6, SyncDescriptor7, SyncDescriptor8 } from './vs/platform/instantiation/common/descriptors';
|
||||||
import { DiffNavigator } from './vs/editor/browser/widget/diffNavigator';
|
import { DiffNavigator } from './vs/editor/browser/widget/diffNavigator';
|
||||||
|
import { DocumentRangeFormattingEditProvider } from './vs/editor/common/modes';
|
||||||
import * as editorAPI from './vs/editor/editor.api';
|
import * as editorAPI from './vs/editor/editor.api';
|
||||||
|
|
||||||
(function () {
|
(function () {
|
||||||
@@ -22,6 +24,7 @@ import * as editorAPI from './vs/editor/editor.api';
|
|||||||
a = (<IWorkspaceContextService>b).getWorkspace; // IWorkspaceFolderProvider
|
a = (<IWorkspaceContextService>b).getWorkspace; // IWorkspaceFolderProvider
|
||||||
a = (<CountBadge>b).style; // IThemable
|
a = (<CountBadge>b).style; // IThemable
|
||||||
a = (<QuickOpenWidget>b).style; // IThemable
|
a = (<QuickOpenWidget>b).style; // IThemable
|
||||||
|
a = (<WorkbenchAsyncDataTree<any,any>>b).style; // IThemable
|
||||||
a = (<IEnvironmentService>b).userHome; // IUserHomeProvider
|
a = (<IEnvironmentService>b).userHome; // IUserHomeProvider
|
||||||
a = (<DiffNavigator>b).previous; // IDiffNavigator
|
a = (<DiffNavigator>b).previous; // IDiffNavigator
|
||||||
a = (<ServiceIdentifier<any>>b).type;
|
a = (<ServiceIdentifier<any>>b).type;
|
||||||
@@ -30,6 +33,7 @@ import * as editorAPI from './vs/editor/editor.api';
|
|||||||
a = (<SimpleWorkerClient<any>>b).getProxyObject; // IWorkerClient
|
a = (<SimpleWorkerClient<any>>b).getProxyObject; // IWorkerClient
|
||||||
a = create1;
|
a = create1;
|
||||||
a = create2;
|
a = create2;
|
||||||
|
a = (<DocumentRangeFormattingEditProvider>b).extensionId;
|
||||||
|
|
||||||
// injection madness
|
// injection madness
|
||||||
a = (<SyncDescriptor0<any>>b).ctor;
|
a = (<SyncDescriptor0<any>>b).ctor;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "monaco-editor-core",
|
"name": "monaco-editor-core",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.14.3",
|
"version": "0.16.0",
|
||||||
"description": "A browser based code editor",
|
"description": "A browser based code editor",
|
||||||
"author": "Microsoft Corporation",
|
"author": "Microsoft Corporation",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
0
build/monaco/version.txt
Normal file
0
build/monaco/version.txt
Normal file
@@ -12,6 +12,8 @@ var cson = require('cson-parser');
|
|||||||
var https = require('https');
|
var https = require('https');
|
||||||
var url = require('url');
|
var url = require('url');
|
||||||
|
|
||||||
|
let commitDate = '0000-00-00';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} urlString
|
* @param {string} urlString
|
||||||
*/
|
*/
|
||||||
@@ -120,30 +122,35 @@ exports.update = function (repoId, repoPath, dest, modifyGrammar, version = 'mas
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
fs.writeFileSync(dest, JSON.stringify(result, null, '\t').replace(/\n/g, '\r\n'));
|
fs.writeFileSync(dest, JSON.stringify(result, null, '\t').replace(/\n/g, '\r\n'));
|
||||||
// Add commit sha to cgmanifest
|
|
||||||
let cgmanifestRead = JSON.parse(fs.readFileSync('./cgmanifest.json').toString());
|
let cgmanifestRead = JSON.parse(fs.readFileSync('./cgmanifest.json').toString());
|
||||||
let promises = new Array();
|
let promises = new Array();
|
||||||
|
const currentCommitDate = info.commitDate.substr(0, 10);
|
||||||
|
|
||||||
|
// Add commit sha to cgmanifest.
|
||||||
|
if (currentCommitDate > commitDate) {
|
||||||
let packageJsonPath = 'https://raw.githubusercontent.com/' + repoId + `/${info.commitSha}/package.json`;
|
let packageJsonPath = 'https://raw.githubusercontent.com/' + repoId + `/${info.commitSha}/package.json`;
|
||||||
for (let i = 0; i < cgmanifestRead.registrations.length; i++) {
|
for (let i = 0; i < cgmanifestRead.registrations.length; i++) {
|
||||||
if (cgmanifestRead.registrations[i].component.git.repositoryUrl.substr(cgmanifestRead.registrations[i].component.git.repositoryUrl.length - repoId.length, repoId.length) === repoId) {
|
if (cgmanifestRead.registrations[i].component.git.repositoryUrl.substr(cgmanifestRead.registrations[i].component.git.repositoryUrl.length - repoId.length, repoId.length) === repoId) {
|
||||||
cgmanifestRead.registrations[i].component.git.commitHash = info.commitSha;
|
cgmanifestRead.registrations[i].component.git.commitHash = info.commitSha;
|
||||||
|
commitDate = currentCommitDate;
|
||||||
promises.push(download(packageJsonPath).then(function (packageJson) {
|
promises.push(download(packageJsonPath).then(function (packageJson) {
|
||||||
if (packageJson) {
|
if (packageJson) {
|
||||||
try {
|
try {
|
||||||
cgmanifestRead.registrations[i].version = JSON.parse(packageJson).version;
|
cgmanifestRead.registrations[i].version = JSON.parse(packageJson).version;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log('File does not exist at' + packageJsonPath);
|
console.log('Cannot get version. File does not exist at ' + packageJsonPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Promise.all(promises).then(function (allResult) {
|
Promise.all(promises).then(function (allResult) {
|
||||||
fs.writeFileSync('./cgmanifest.json', JSON.stringify(cgmanifestRead, null, '\t').replace(/\n/g, '\r\n'));
|
fs.writeFileSync('./cgmanifest.json', JSON.stringify(cgmanifestRead, null, '\t').replace(/\n/g, '\r\n'));
|
||||||
});
|
});
|
||||||
if (info) {
|
if (info) {
|
||||||
console.log('Updated ' + path.basename(dest) + ' to ' + repoId + '@' + info.commitSha.substr(0, 7) + ' (' + info.commitDate.substr(0, 10) + ')');
|
console.log('Updated ' + path.basename(dest) + ' to ' + repoId + '@' + info.commitSha.substr(0, 7) + ' (' + currentCommitDate + ')');
|
||||||
} else {
|
} else {
|
||||||
console.log('Updated ' + path.basename(dest));
|
console.log('Updated ' + path.basename(dest));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,9 +2,11 @@
|
|||||||
"name": "azuredatastudio-oss-dev-build",
|
"name": "azuredatastudio-oss-dev-build",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@types/ansi-colors": "^3.2.0",
|
||||||
"@types/azure": "0.9.19",
|
"@types/azure": "0.9.19",
|
||||||
"@types/debounce": "^1.0.0",
|
"@types/debounce": "^1.0.0",
|
||||||
"@types/documentdb": "1.10.2",
|
"@types/documentdb": "1.10.2",
|
||||||
|
"@types/fancy-log": "^1.3.0",
|
||||||
"@types/glob": "^7.1.1",
|
"@types/glob": "^7.1.1",
|
||||||
"@types/gulp": "^4.0.5",
|
"@types/gulp": "^4.0.5",
|
||||||
"@types/gulp-concat": "^0.0.32",
|
"@types/gulp-concat": "^0.0.32",
|
||||||
@@ -13,7 +15,6 @@
|
|||||||
"@types/gulp-rename": "^0.0.33",
|
"@types/gulp-rename": "^0.0.33",
|
||||||
"@types/gulp-sourcemaps": "^0.0.32",
|
"@types/gulp-sourcemaps": "^0.0.32",
|
||||||
"@types/gulp-uglify": "^3.0.5",
|
"@types/gulp-uglify": "^3.0.5",
|
||||||
"@types/gulp-util": "^3.0.34",
|
|
||||||
"@types/mime": "0.0.29",
|
"@types/mime": "0.0.29",
|
||||||
"@types/minimatch": "^3.0.3",
|
"@types/minimatch": "^3.0.3",
|
||||||
"@types/minimist": "^1.2.0",
|
"@types/minimist": "^1.2.0",
|
||||||
@@ -42,7 +43,7 @@
|
|||||||
"request": "^2.85.0",
|
"request": "^2.85.0",
|
||||||
"tslint": "^5.9.1",
|
"tslint": "^5.9.1",
|
||||||
"service-downloader": "github:anthonydresser/service-downloader#0.1.5",
|
"service-downloader": "github:anthonydresser/service-downloader#0.1.5",
|
||||||
"typescript": "3.2.2",
|
"typescript": "3.3.1",
|
||||||
"vsce": "1.48.0",
|
"vsce": "1.48.0",
|
||||||
"xml2js": "^0.4.17"
|
"xml2js": "^0.4.17"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#define LocalizedLanguageFile(Language = "") \
|
#define LocalizedLanguageFile(Language = "") \
|
||||||
DirExists(RepoDir + "\licenses") && Language != "" \
|
DirExists(RepoDir + "\licenses") && Language != "" \
|
||||||
? ('; LicenseFile: "' + RepoDir + '\licenses\LICENSE-' + Language + '.txt"') \
|
? ('; LicenseFile: "' + RepoDir + '\licenses\LICENSE-' + Language + '.rtf"') \
|
||||||
: '; LicenseFile: "' + RepoDir + '\LICENSE.txt"'
|
: '; LicenseFile: "' + RepoDir + '\LICENSE.rtf"'
|
||||||
|
|
||||||
[Setup]
|
[Setup]
|
||||||
AppId={#AppId}
|
AppId={#AppId}
|
||||||
|
|||||||
784
build/yarn.lock
784
build/yarn.lock
File diff suppressed because it is too large
Load Diff
@@ -73,12 +73,12 @@
|
|||||||
"git": {
|
"git": {
|
||||||
"name": "electron",
|
"name": "electron",
|
||||||
"repositoryUrl": "https://github.com/electron/electron",
|
"repositoryUrl": "https://github.com/electron/electron",
|
||||||
"commitHash": "bb28fa8e8e797db249a66405146ad0501eaf411a"
|
"commitHash": "73158a6419a3e2da9e4d523e1131052abd28fbbb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"isOnlyProductionDependency": true,
|
"isOnlyProductionDependency": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"version": "3.1.2"
|
"version": "3.1.6"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"component": {
|
"component": {
|
||||||
|
|||||||
@@ -6,11 +6,11 @@
|
|||||||
"git": {
|
"git": {
|
||||||
"name": "mmims/language-batchfile",
|
"name": "mmims/language-batchfile",
|
||||||
"repositoryUrl": "https://github.com/mmims/language-batchfile",
|
"repositoryUrl": "https://github.com/mmims/language-batchfile",
|
||||||
"commitHash": "4b67596631b4ecd2c89c2ec1b2e08a6623438903"
|
"commitHash": "95ea8c699f7a8296b15767069868532d52631c46"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"version": "0.7.4"
|
"version": "0.7.5"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"version": 1
|
"version": 1
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
|
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
|
||||||
"Once accepted there, we are happy to receive an update request."
|
"Once accepted there, we are happy to receive an update request."
|
||||||
],
|
],
|
||||||
"version": "https://github.com/mmims/language-batchfile/commit/4b67596631b4ecd2c89c2ec1b2e08a6623438903",
|
"version": "https://github.com/mmims/language-batchfile/commit/95ea8c699f7a8296b15767069868532d52631c46",
|
||||||
"name": "Batch File",
|
"name": "Batch File",
|
||||||
"scopeName": "source.batchfile",
|
"scopeName": "source.batchfile",
|
||||||
"patterns": [
|
"patterns": [
|
||||||
@@ -46,7 +46,7 @@
|
|||||||
"commands": {
|
"commands": {
|
||||||
"patterns": [
|
"patterns": [
|
||||||
{
|
{
|
||||||
"match": "(?<=^|[\\s@])(?i:adprep|append|arp|assoc|at|atmadm|attrib|auditpol|autochk|autoconv|autofmt|bcdboot|bcdedit|bdehdcfg|bitsadmin|bootcfg|brea|cacls|cd|certreq|certutil|change|chcp|chdir|chglogon|chgport|chgusr|chkdsk|chkntfs|choice|cipher|clip|cls|clscluadmin|cluster|cmd|cmdkey|cmstp|color|comp|compact|convert|copy|cprofile|cscript|csvde|date|dcdiag|dcgpofix|dcpromo|defra|del|dfscmd|dfsdiag|dfsrmig|diantz|dir|dirquota|diskcomp|diskcopy|diskpart|diskperf|diskraid|diskshadow|dispdiag|doin|dnscmd|doskey|driverquery|dsacls|dsadd|dsamain|dsdbutil|dsget|dsmgmt|dsmod|dsmove|dsquery|dsrm|edit|endlocal|eraseesentutl|eventcreate|eventquery|eventtriggers|evntcmd|expand|extract|fc|filescrn|find|findstr|finger|flattemp|fonde|forfiles|format|freedisk|fsutil|ftp|ftype|fveupdate|getmac|gettype|gpfixup|gpresult|gpupdate|graftabl|hashgen|hep|helpctr|hostname|icacls|iisreset|inuse|ipconfig|ipxroute|irftp|ismserv|jetpack|klist|ksetup|ktmutil|ktpass|label|ldifd|ldp|lodctr|logman|logoff|lpq|lpr|macfile|makecab|manage-bde|mapadmin|md|mkdir|mklink|mmc|mode|more|mount|mountvol|move|mqbup|mqsvc|mqtgsvc|msdt|msg|msiexec|msinfo32|mstsc|nbtstat|net computer|net group|net localgroup|net print|net session|net share|net start|net stop|net use|net user|net view|net|netcfg|netdiag|netdom|netsh|netstat|nfsadmin|nfsshare|nfsstat|nlb|nlbmgr|nltest|nslookup|ntackup|ntcmdprompt|ntdsutil|ntfrsutl|openfiles|pagefileconfig|path|pathping|pause|pbadmin|pentnt|perfmon|ping|pnpunatten|pnputil|popd|powercfg|powershell|powershell_ise|print|prncnfg|prndrvr|prnjobs|prnmngr|prnport|prnqctl|prompt|pubprn|pushd|pushprinterconnections|pwlauncher|qappsrv|qprocess|query|quser|qwinsta|rasdial|rcp|rd|rdpsign|regentc|recover|redircmp|redirusr|reg|regini|regsvr32|relog|ren|rename|rendom|repadmin|repair-bde|replace|reset session|rxec|risetup|rmdir|robocopy|route|rpcinfo|rpcping|rsh|runas|rundll32|rwinsta|sc|schtasks|scwcmd|secedit|serverceipoptin|servrmanagercmd|serverweroptin|setspn|setx|sfc|shadow|shift|showmount|shutdown|sort|start|storrept|subst|sxstrace|ysocmgr|systeminfo|takeown|tapicfg|taskkill|tasklist|tcmsetup|telnet|tftp|time|timeout|title|tlntadmn|tpmvscmgr|tpmvscmgr|tacerpt|tracert|tree|tscon|tsdiscon|tsecimp|tskill|tsprof|type|typeperf|tzutil|uddiconfig|umount|unlodctr|ver|verifier|verif|vol|vssadmin|w32tm|waitfor|wbadmin|wdsutil|wecutil|wevtutil|where|whoami|winnt|winnt32|winpop|winrm|winrs|winsat|wlbs|mic|wscript|xcopy)(?=$|\\s)",
|
"match": "(?<=^|[\\s@])(?i:adprep|append|arp|assoc|at|atmadm|attrib|auditpol|autochk|autoconv|autofmt|bcdboot|bcdedit|bdehdcfg|bitsadmin|bootcfg|brea|cacls|cd|certreq|certutil|change|chcp|chdir|chglogon|chgport|chgusr|chkdsk|chkntfs|choice|cipher|clip|cls|clscluadmin|cluster|cmd|cmdkey|cmstp|color|comp|compact|convert|copy|cprofile|cscript|csvde|date|dcdiag|dcgpofix|dcpromo|defra|del|dfscmd|dfsdiag|dfsrmig|diantz|dir|dirquota|diskcomp|diskcopy|diskpart|diskperf|diskraid|diskshadow|dispdiag|doin|dnscmd|doskey|driverquery|dsacls|dsadd|dsamain|dsdbutil|dsget|dsmgmt|dsmod|dsmove|dsquery|dsrm|edit|endlocal|eraseesentutl|eventcreate|eventquery|eventtriggers|evntcmd|expand|extract|fc|filescrn|find|findstr|finger|flattemp|fonde|forfiles|format|freedisk|fsutil|ftp|ftype|fveupdate|getmac|gettype|gpfixup|gpresult|gpupdate|graftabl|hashgen|hep|helpctr|hostname|icacls|iisreset|inuse|ipconfig|ipxroute|irftp|ismserv|jetpack|klist|ksetup|ktmutil|ktpass|label|ldifd|ldp|lodctr|logman|logoff|lpq|lpr|macfile|makecab|manage-bde|mapadmin|md|mkdir|mklink|mmc|mode|more|mount|mountvol|move|mqbup|mqsvc|mqtgsvc|msdt|msg|msiexec|msinfo32|mstsc|nbtstat|net computer|net group|net localgroup|net print|net session|net share|net start|net stop|net use|net user|net view|net|netcfg|netdiag|netdom|netsh|netstat|nfsadmin|nfsshare|nfsstat|nlb|nlbmgr|nltest|nslookup|ntackup|ntcmdprompt|ntdsutil|ntfrsutl|openfiles|pagefileconfig|path|pathping|pause|pbadmin|pentnt|perfmon|ping|pnpunatten|pnputil|popd|powercfg|powershell|powershell_ise|print|prncnfg|prndrvr|prnjobs|prnmngr|prnport|prnqctl|prompt|pubprn|pushd|pushprinterconnections|pwlauncher|qappsrv|qprocess|query|quser|qwinsta|rasdial|rcp|rd|rdpsign|regentc|recover|redircmp|redirusr|reg|regini|regsvr32|relog|ren|rename|rendom|repadmin|repair-bde|replace|reset session|rxec|risetup|rmdir|robocopy|route|rpcinfo|rpcping|rsh|runas|rundll32|rwinsta|scp|sc|schtasks|scwcmd|secedit|serverceipoptin|servrmanagercmd|serverweroptin|setspn|setx|sfc|shadow|shift|showmount|shutdown|sort|ssh|start|storrept|subst|sxstrace|ysocmgr|systeminfo|takeown|tapicfg|taskkill|tasklist|tcmsetup|telnet|tftp|time|timeout|title|tlntadmn|tpmvscmgr|tpmvscmgr|tacerpt|tracert|tree|tscon|tsdiscon|tsecimp|tskill|tsprof|type|typeperf|tzutil|uddiconfig|umount|unlodctr|ver|verifier|verif|vol|vssadmin|w32tm|waitfor|wbadmin|wdsutil|wecutil|wevtutil|where|whoami|winnt|winnt32|winpop|winrm|winrs|winsat|wlbs|mic|wscript|xcopy)(?=$|\\s)",
|
||||||
"name": "keyword.command.batchfile"
|
"name": "keyword.command.batchfile"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -96,6 +96,6 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^8.10.25"
|
"@types/node": "^10.12.21"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,9 +22,6 @@ const fadedDecoration = 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
|
|
||||||
context.subscriptions.push(registerKeybindingsCompletions());
|
|
||||||
|
|
||||||
//settings.json suggestions
|
//settings.json suggestions
|
||||||
context.subscriptions.push(registerSettingsCompletions());
|
context.subscriptions.push(registerSettingsCompletions());
|
||||||
|
|
||||||
@@ -94,23 +91,6 @@ function autoFixSettingsJSON(willSaveEvent: vscode.TextDocumentWillSaveEvent): v
|
|||||||
vscode.workspace.applyEdit(edit));
|
vscode.workspace.applyEdit(edit));
|
||||||
}
|
}
|
||||||
|
|
||||||
function registerKeybindingsCompletions(): vscode.Disposable {
|
|
||||||
const commands = vscode.commands.getCommands(true);
|
|
||||||
|
|
||||||
return vscode.languages.registerCompletionItemProvider({ pattern: '**/keybindings.json' }, {
|
|
||||||
|
|
||||||
provideCompletionItems(document, position, _token) {
|
|
||||||
const location = getLocation(document.getText(), document.offsetAt(position));
|
|
||||||
if (location.path[1] === 'command') {
|
|
||||||
|
|
||||||
const range = document.getWordRangeAtPosition(position) || new vscode.Range(position, position);
|
|
||||||
return commands.then(ids => ids.map(id => newSimpleCompletionItem(JSON.stringify(id), range)));
|
|
||||||
}
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function registerSettingsCompletions(): vscode.Disposable {
|
function registerSettingsCompletions(): vscode.Disposable {
|
||||||
return vscode.languages.registerCompletionItemProvider({ language: 'jsonc', pattern: '**/settings.json' }, {
|
return vscode.languages.registerCompletionItemProvider({ language: 'jsonc', pattern: '**/settings.json' }, {
|
||||||
provideCompletionItems(document, position, token) {
|
provideCompletionItems(document, position, token) {
|
||||||
@@ -207,16 +187,6 @@ function provideInstalledExtensionProposals(extensionsContent: IExtensionsConten
|
|||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
function newSimpleCompletionItem(label: string, range: vscode.Range, description?: string, insertText?: string): vscode.CompletionItem {
|
|
||||||
const item = new vscode.CompletionItem(label);
|
|
||||||
item.kind = vscode.CompletionItemKind.Value;
|
|
||||||
item.detail = description;
|
|
||||||
item.insertText = insertText || label;
|
|
||||||
item.range = range;
|
|
||||||
|
|
||||||
return item;
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateLaunchJsonDecorations(editor: vscode.TextEditor | undefined): void {
|
function updateLaunchJsonDecorations(editor: vscode.TextEditor | undefined): void {
|
||||||
if (!editor || path.basename(editor.document.fileName) !== 'launch.json') {
|
if (!editor || path.basename(editor.document.fileName) !== 'launch.json') {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
# yarn lockfile v1
|
# yarn lockfile v1
|
||||||
|
|
||||||
|
|
||||||
"@types/node@^8.10.25":
|
"@types/node@^10.12.21":
|
||||||
version "8.10.25"
|
version "10.12.21"
|
||||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.25.tgz#801fe4e39372cef18f268db880a5fbfcf71adc7e"
|
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e"
|
||||||
integrity sha512-WXvAXaknB0c2cJ7N44e1kUrVu5K90mSfPPaT5XxfuSMxEWva86EYIwxUZM3jNZ2P1CIC9e2z4WJqpAF69PQxeA==
|
integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ==
|
||||||
|
|
||||||
jsonc-parser@2.0.2:
|
jsonc-parser@2.0.2:
|
||||||
version "2.0.2"
|
version "2.0.2"
|
||||||
|
|||||||
@@ -45,5 +45,10 @@
|
|||||||
"htmlparser2": "^3.10.1",
|
"htmlparser2": "^3.10.1",
|
||||||
"vscode-nls": "^3.2.1"
|
"vscode-nls": "^3.2.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {}
|
"devDependencies": {},
|
||||||
|
"__metadata": {
|
||||||
|
"id": "33",
|
||||||
|
"publisherDisplayName": "Microsoft",
|
||||||
|
"publisherId": "Microsoft"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -53,6 +53,6 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/markdown-it": "0.0.2",
|
"@types/markdown-it": "0.0.2",
|
||||||
"@types/node": "^8.10.25"
|
"@types/node": "^10.12.21"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,16 +7,16 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@types/markdown-it/-/markdown-it-0.0.2.tgz#5d9ad19e6e6508cdd2f2596df86fd0aade598660"
|
resolved "https://registry.yarnpkg.com/@types/markdown-it/-/markdown-it-0.0.2.tgz#5d9ad19e6e6508cdd2f2596df86fd0aade598660"
|
||||||
integrity sha1-XZrRnm5lCM3S8llt+G/Qqt5ZhmA=
|
integrity sha1-XZrRnm5lCM3S8llt+G/Qqt5ZhmA=
|
||||||
|
|
||||||
|
"@types/node@^10.12.21":
|
||||||
|
version "10.12.21"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e"
|
||||||
|
integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ==
|
||||||
|
|
||||||
"@types/node@^6.0.46":
|
"@types/node@^6.0.46":
|
||||||
version "6.0.78"
|
version "6.0.78"
|
||||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-6.0.78.tgz#5d4a3f579c1524e01ee21bf474e6fba09198f470"
|
resolved "https://registry.yarnpkg.com/@types/node/-/node-6.0.78.tgz#5d4a3f579c1524e01ee21bf474e6fba09198f470"
|
||||||
integrity sha512-+vD6E8ixntRzzZukoF3uP1iV+ZjVN3koTcaeK+BEoc/kSfGbLDIGC7RmCaUgVpUfN6cWvfczFRERCyKM9mkvXg==
|
integrity sha512-+vD6E8ixntRzzZukoF3uP1iV+ZjVN3koTcaeK+BEoc/kSfGbLDIGC7RmCaUgVpUfN6cWvfczFRERCyKM9mkvXg==
|
||||||
|
|
||||||
"@types/node@^8.10.25":
|
|
||||||
version "8.10.25"
|
|
||||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.25.tgz#801fe4e39372cef18f268db880a5fbfcf71adc7e"
|
|
||||||
integrity sha512-WXvAXaknB0c2cJ7N44e1kUrVu5K90mSfPPaT5XxfuSMxEWva86EYIwxUZM3jNZ2P1CIC9e2z4WJqpAF69PQxeA==
|
|
||||||
|
|
||||||
argparse@^1.0.7:
|
argparse@^1.0.7:
|
||||||
version "1.0.9"
|
version "1.0.9"
|
||||||
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86"
|
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
"git": {
|
"git": {
|
||||||
"name": "textmate/git.tmbundle",
|
"name": "textmate/git.tmbundle",
|
||||||
"repositoryUrl": "https://github.com/textmate/git.tmbundle",
|
"repositoryUrl": "https://github.com/textmate/git.tmbundle",
|
||||||
"commitHash": "93897a78c6e52bef13dadc0d4091d203c5facb40"
|
"commitHash": "3f6ad2138200db14b57a090ecb2d2e733275ca3e"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"licenseDetail": [
|
"licenseDetail": [
|
||||||
|
|||||||
@@ -320,6 +320,16 @@
|
|||||||
"title": "%command.pushWithTagsForce%",
|
"title": "%command.pushWithTagsForce%",
|
||||||
"category": "Git"
|
"category": "Git"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"command": "git.addRemote",
|
||||||
|
"title": "%command.addRemote%",
|
||||||
|
"category": "Git"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "git.removeRemote",
|
||||||
|
"title": "%command.removeRemote%",
|
||||||
|
"category": "Git"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"command": "git.sync",
|
"command": "git.sync",
|
||||||
"title": "%command.sync%",
|
"title": "%command.sync%",
|
||||||
@@ -570,6 +580,14 @@
|
|||||||
"command": "git.pushWithTagsForce",
|
"command": "git.pushWithTagsForce",
|
||||||
"when": "config.git.enabled && config.git.allowForcePush && gitOpenRepositoryCount != 0"
|
"when": "config.git.enabled && config.git.allowForcePush && gitOpenRepositoryCount != 0"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"command": "git.addRemote",
|
||||||
|
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "git.removeRemote",
|
||||||
|
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"command": "git.sync",
|
"command": "git.sync",
|
||||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||||
@@ -1150,6 +1168,7 @@
|
|||||||
"%config.postCommitCommand.sync%"
|
"%config.postCommitCommand.sync%"
|
||||||
],
|
],
|
||||||
"markdownDescription": "%config.postCommitCommand%",
|
"markdownDescription": "%config.postCommitCommand%",
|
||||||
|
"scope": "resource",
|
||||||
"default": "none"
|
"default": "none"
|
||||||
},
|
},
|
||||||
"git.showInlineOpenFileAction": {
|
"git.showInlineOpenFileAction": {
|
||||||
@@ -1182,7 +1201,7 @@
|
|||||||
"number",
|
"number",
|
||||||
"null"
|
"null"
|
||||||
],
|
],
|
||||||
"default": null,
|
"default": 50,
|
||||||
"description": "%config.inputValidationSubjectLength%"
|
"description": "%config.inputValidationSubjectLength%"
|
||||||
},
|
},
|
||||||
"git.detectSubmodules": {
|
"git.detectSubmodules": {
|
||||||
@@ -1425,7 +1444,7 @@
|
|||||||
"@types/byline": "4.2.31",
|
"@types/byline": "4.2.31",
|
||||||
"@types/file-type": "^5.2.1",
|
"@types/file-type": "^5.2.1",
|
||||||
"@types/mocha": "2.2.43",
|
"@types/mocha": "2.2.43",
|
||||||
"@types/node": "^8.10.25",
|
"@types/node": "^10.12.21",
|
||||||
"@types/which": "^1.0.28",
|
"@types/which": "^1.0.28",
|
||||||
"mocha": "^3.2.0"
|
"mocha": "^3.2.0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,6 +48,8 @@
|
|||||||
"command.pushToForce": "Push to... (Force)",
|
"command.pushToForce": "Push to... (Force)",
|
||||||
"command.pushWithTags": "Push With Tags",
|
"command.pushWithTags": "Push With Tags",
|
||||||
"command.pushWithTagsForce": "Push With Tags (Force)",
|
"command.pushWithTagsForce": "Push With Tags (Force)",
|
||||||
|
"command.addRemote": "Add Remote",
|
||||||
|
"command.removeRemote": "Remove Remote",
|
||||||
"command.sync": "Sync",
|
"command.sync": "Sync",
|
||||||
"command.syncRebase": "Sync (Rebase)",
|
"command.syncRebase": "Sync (Rebase)",
|
||||||
"command.publish": "Publish Branch",
|
"command.publish": "Publish Branch",
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ export class Askpass implements Disposable {
|
|||||||
return ipcHandlePath;
|
return ipcHandlePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
private onRequest(req: http.ServerRequest, res: http.ServerResponse): void {
|
private onRequest(req: http.IncomingMessage, res: http.ServerResponse): void {
|
||||||
const chunks: string[] = [];
|
const chunks: string[] = [];
|
||||||
req.setEncoding('utf8');
|
req.setEncoding('utf8');
|
||||||
req.on('data', (d: string) => chunks.push(d));
|
req.on('data', (d: string) => chunks.push(d));
|
||||||
|
|||||||
@@ -649,14 +649,16 @@ export class CommandCenter {
|
|||||||
|
|
||||||
if (!(resource instanceof Resource)) {
|
if (!(resource instanceof Resource)) {
|
||||||
// can happen when called from a keybinding
|
// can happen when called from a keybinding
|
||||||
|
console.log('WHAT');
|
||||||
resource = this.getSCMResource();
|
resource = this.getSCMResource();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (resource) {
|
if (resource) {
|
||||||
const resources = ([resource, ...resourceStates] as Resource[])
|
uris = ([resource, ...resourceStates] as Resource[])
|
||||||
.filter(r => r.type !== Status.DELETED && r.type !== Status.INDEX_DELETED);
|
.filter(r => r.type !== Status.DELETED && r.type !== Status.INDEX_DELETED)
|
||||||
|
.map(r => r.resourceUri);
|
||||||
uris = resources.map(r => r.resourceUri);
|
} else if (window.activeTextEditor) {
|
||||||
|
uris = [window.activeTextEditor.document.uri];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -665,6 +667,7 @@ export class CommandCenter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const activeTextEditor = window.activeTextEditor;
|
const activeTextEditor = window.activeTextEditor;
|
||||||
|
|
||||||
for (const uri of uris) {
|
for (const uri of uris) {
|
||||||
const opts: TextDocumentShowOptions = {
|
const opts: TextDocumentShowOptions = {
|
||||||
preserveFocus,
|
preserveFocus,
|
||||||
@@ -1458,8 +1461,7 @@ export class CommandCenter {
|
|||||||
name.trim().replace(/^\.|\/\.|\.\.|~|\^|:|\/$|\.lock$|\.lock\/|\\|\*|\s|^\s*$|\.$|\[|\]$/g, branchWhitespaceChar)
|
name.trim().replace(/^\.|\/\.|\.\.|~|\^|:|\/$|\.lock$|\.lock\/|\\|\*|\s|^\s*$|\.$|\[|\]$/g, branchWhitespaceChar)
|
||||||
: name;
|
: name;
|
||||||
|
|
||||||
const rawBranchName = await window.showInputBox({
|
const rawBranchName = defaultName || await window.showInputBox({
|
||||||
value: defaultName,
|
|
||||||
placeHolder: localize('branch name', "Branch name"),
|
placeHolder: localize('branch name', "Branch name"),
|
||||||
prompt: localize('provide branch name', "Please provide a branch name"),
|
prompt: localize('provide branch name', "Please provide a branch name"),
|
||||||
ignoreFocusOut: true,
|
ignoreFocusOut: true,
|
||||||
@@ -1480,7 +1482,7 @@ export class CommandCenter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const picks = [new HEADItem(repository), ...createCheckoutItems(repository)];
|
const picks = [new HEADItem(repository), ...createCheckoutItems(repository)];
|
||||||
const placeHolder = localize('select a ref to create a new branch from', 'Select a ref to create a new branch from');
|
const placeHolder = localize('select a ref to create a new branch from', 'Select a ref to create the \'{0}\' branch from', branchName);
|
||||||
const target = await window.showQuickPick(picks, { placeHolder });
|
const target = await window.showQuickPick(picks, { placeHolder });
|
||||||
|
|
||||||
if (!target) {
|
if (!target) {
|
||||||
@@ -1801,6 +1803,72 @@ export class CommandCenter {
|
|||||||
await this._push(repository, { pushType: PushType.PushTo, forcePush: true });
|
await this._push(repository, { pushType: PushType.PushTo, forcePush: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@command('git.addRemote', { repository: true })
|
||||||
|
async addRemote(repository: Repository): Promise<void> {
|
||||||
|
const remotes = repository.remotes;
|
||||||
|
|
||||||
|
const sanitize = (name: string) => {
|
||||||
|
name = name.trim();
|
||||||
|
return name && name.replace(/^\.|\/\.|\.\.|~|\^|:|\/$|\.lock$|\.lock\/|\\|\*|\s|^\s*$|\.$|\[|\]$/g, '-');
|
||||||
|
};
|
||||||
|
|
||||||
|
const resultName = await window.showInputBox({
|
||||||
|
placeHolder: localize('remote name', "Remote name"),
|
||||||
|
prompt: localize('provide remote name', "Please provide a remote name"),
|
||||||
|
ignoreFocusOut: true,
|
||||||
|
validateInput: (name: string) => {
|
||||||
|
if (sanitize(name)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return localize('remote name format invalid', "Remote name format invalid");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const name = sanitize(resultName || '');
|
||||||
|
|
||||||
|
if (!name) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (remotes.find(r => r.name === name)) {
|
||||||
|
window.showErrorMessage(localize('remote already exists', "Remote '{0}' already exists.", name));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const url = await window.showInputBox({
|
||||||
|
placeHolder: localize('remote url', "Remote URL"),
|
||||||
|
prompt: localize('provide remote URL', "Enter URL for remote \"{0}\"", name),
|
||||||
|
ignoreFocusOut: true
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!url) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
await repository.addRemote(name, url);
|
||||||
|
}
|
||||||
|
|
||||||
|
@command('git.removeRemote', { repository: true })
|
||||||
|
async removeRemote(repository: Repository): Promise<void> {
|
||||||
|
const remotes = repository.remotes;
|
||||||
|
|
||||||
|
if (remotes.length === 0) {
|
||||||
|
window.showErrorMessage(localize('no remotes added', "Your repository has no remotes."));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const picks = remotes.map(r => r.name);
|
||||||
|
const placeHolder = localize('remove remote', "Pick a remote to remove");
|
||||||
|
|
||||||
|
const remoteName = await window.showQuickPick(picks, { placeHolder });
|
||||||
|
|
||||||
|
if (!remoteName) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
await repository.removeRemote(remoteName);
|
||||||
|
}
|
||||||
|
|
||||||
private async _sync(repository: Repository, rebase: boolean): Promise<void> {
|
private async _sync(repository: Repository, rebase: boolean): Promise<void> {
|
||||||
const HEAD = repository.HEAD;
|
const HEAD = repository.HEAD;
|
||||||
|
|
||||||
@@ -2118,6 +2186,7 @@ export class CommandCenter {
|
|||||||
uri = uri ? uri : (window.activeTextEditor && window.activeTextEditor.document.uri);
|
uri = uri ? uri : (window.activeTextEditor && window.activeTextEditor.document.uri);
|
||||||
|
|
||||||
this.outputChannel.appendLine(`git.getSCMResource.uri ${uri && uri.toString()}`);
|
this.outputChannel.appendLine(`git.getSCMResource.uri ${uri && uri.toString()}`);
|
||||||
|
|
||||||
for (const r of this.model.repositories.map(r => r.root)) {
|
for (const r of this.model.repositories.map(r => r.root)) {
|
||||||
this.outputChannel.appendLine(`repo root ${r}`);
|
this.outputChannel.appendLine(`repo root ${r}`);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ class GitIgnoreDecorationProvider implements DecorationProvider {
|
|||||||
private disposables: Disposable[] = [];
|
private disposables: Disposable[] = [];
|
||||||
|
|
||||||
constructor(private model: Model) {
|
constructor(private model: Model) {
|
||||||
//todo@joh -> events when the ignore status actually changes, not only when the file changes
|
|
||||||
this.onDidChangeDecorations = fireEvent(anyEvent<any>(
|
this.onDidChangeDecorations = fireEvent(anyEvent<any>(
|
||||||
filterEvent(workspace.onDidSaveTextDocument, e => e.fileName.endsWith('.gitignore')),
|
filterEvent(workspace.onDidSaveTextDocument, e => e.fileName.endsWith('.gitignore')),
|
||||||
model.onDidOpenRepository,
|
model.onDidOpenRepository,
|
||||||
@@ -119,7 +118,7 @@ class GitDecorationProvider implements DecorationProvider {
|
|||||||
|
|
||||||
const uris = new Set([...this.decorations.keys()].concat([...newDecorations.keys()]));
|
const uris = new Set([...this.decorations.keys()].concat([...newDecorations.keys()]));
|
||||||
this.decorations = newDecorations;
|
this.decorations = newDecorations;
|
||||||
this._onDidChangeDecorations.fire([...uris.values()].map(Uri.parse));
|
this._onDidChangeDecorations.fire([...uris.values()].map(value => Uri.parse(value, true)));
|
||||||
}
|
}
|
||||||
|
|
||||||
private collectDecorationData(group: GitResourceGroup, bucket: Map<string, DecorationData>): void {
|
private collectDecorationData(group: GitResourceGroup, bucket: Map<string, DecorationData>): void {
|
||||||
|
|||||||
@@ -349,7 +349,7 @@ export class Git {
|
|||||||
await mkdirp(parentPath);
|
await mkdirp(parentPath);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this.exec(parentPath, ['clone', url, folderPath], { cancellationToken });
|
await this.exec(parentPath, ['clone', url.includes(' ') ? encodeURI(url) : url, folderPath], { cancellationToken });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err.stderr) {
|
if (err.stderr) {
|
||||||
err.stderr = err.stderr.replace(/^Cloning.+$/m, '').trim();
|
err.stderr = err.stderr.replace(/^Cloning.+$/m, '').trim();
|
||||||
@@ -1201,7 +1201,7 @@ export class Repository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async branch(name: string, checkout: boolean, ref?: string): Promise<void> {
|
async branch(name: string, checkout: boolean, ref?: string): Promise<void> {
|
||||||
const args = checkout ? ['checkout', '-q', '-b', name] : ['branch', '-q', name];
|
const args = checkout ? ['checkout', '-q', '-b', name, '--no-track'] : ['branch', '-q', name];
|
||||||
|
|
||||||
if (ref) {
|
if (ref) {
|
||||||
args.push(ref);
|
args.push(ref);
|
||||||
@@ -1456,14 +1456,14 @@ export class Repository {
|
|||||||
|
|
||||||
async createStash(message?: string, includeUntracked?: boolean): Promise<void> {
|
async createStash(message?: string, includeUntracked?: boolean): Promise<void> {
|
||||||
try {
|
try {
|
||||||
const args = ['stash', 'save'];
|
const args = ['stash', 'push'];
|
||||||
|
|
||||||
if (includeUntracked) {
|
if (includeUntracked) {
|
||||||
args.push('-u');
|
args.push('-u');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (message) {
|
if (message) {
|
||||||
args.push('--', message);
|
args.push('-m', message);
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.run(args);
|
await this.run(args);
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ export class Resource implements SourceControlResourceState {
|
|||||||
case Status.INDEX_ADDED:
|
case Status.INDEX_ADDED:
|
||||||
case Status.INTENT_TO_ADD:
|
case Status.INTENT_TO_ADD:
|
||||||
return new ThemeColor('gitDecoration.addedResourceForeground');
|
return new ThemeColor('gitDecoration.addedResourceForeground');
|
||||||
case Status.INDEX_RENAMED: // todo@joh - special color?
|
case Status.INDEX_RENAMED:
|
||||||
case Status.UNTRACKED:
|
case Status.UNTRACKED:
|
||||||
return new ThemeColor('gitDecoration.untrackedResourceForeground');
|
return new ThemeColor('gitDecoration.untrackedResourceForeground');
|
||||||
case Status.IGNORED:
|
case Status.IGNORED:
|
||||||
@@ -673,20 +673,6 @@ export class Repository implements Disposable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// const subjectThreshold =
|
|
||||||
|
|
||||||
|
|
||||||
// Math.max(config.get<number>('inputValidationLength') || 50, config.get<number>('subjectValidationLength') || 50, 0) || 50;
|
|
||||||
|
|
||||||
if (line.length <= threshold) {
|
if (line.length <= threshold) {
|
||||||
if (setting !== 'always') {
|
if (setting !== 'always') {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -26,10 +26,10 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.51.tgz#b31d716fb8d58eeb95c068a039b9b6292817d5fb"
|
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.51.tgz#b31d716fb8d58eeb95c068a039b9b6292817d5fb"
|
||||||
integrity sha512-El3+WJk2D/ppWNd2X05aiP5l2k4EwF7KwheknQZls+I26eSICoWRhRIJ56jGgw2dqNGQ5LtNajmBU2ajS28EvQ==
|
integrity sha512-El3+WJk2D/ppWNd2X05aiP5l2k4EwF7KwheknQZls+I26eSICoWRhRIJ56jGgw2dqNGQ5LtNajmBU2ajS28EvQ==
|
||||||
|
|
||||||
"@types/node@^8.10.25":
|
"@types/node@^10.12.21":
|
||||||
version "8.10.25"
|
version "10.12.21"
|
||||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.25.tgz#801fe4e39372cef18f268db880a5fbfcf71adc7e"
|
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e"
|
||||||
integrity sha512-WXvAXaknB0c2cJ7N44e1kUrVu5K90mSfPPaT5XxfuSMxEWva86EYIwxUZM3jNZ2P1CIC9e2z4WJqpAF69PQxeA==
|
integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ==
|
||||||
|
|
||||||
"@types/which@^1.0.28":
|
"@types/which@^1.0.28":
|
||||||
version "1.0.28"
|
version "1.0.28"
|
||||||
|
|||||||
@@ -13,5 +13,6 @@ server/build/**
|
|||||||
server/yarn.lock
|
server/yarn.lock
|
||||||
server/.npmignore
|
server/.npmignore
|
||||||
yarn.lock
|
yarn.lock
|
||||||
|
CONTRIBUTING.md
|
||||||
server/extension.webpack.config.js
|
server/extension.webpack.config.js
|
||||||
extension.webpack.config.js
|
extension.webpack.config.js
|
||||||
39
extensions/json-language-features/CONTRIBUTING.md
Normal file
39
extensions/json-language-features/CONTRIBUTING.md
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
## Setup
|
||||||
|
|
||||||
|
- Clone [Microsoft/vscode](https://github.com/microsoft/vscode)
|
||||||
|
- Run `yarn` at `/`, this will install
|
||||||
|
- Dependencies for `/extension/json-language-features/`
|
||||||
|
- Dependencies for `/extension/json-language-features/server/`
|
||||||
|
- devDependencies such as `gulp`
|
||||||
|
- Open `/extensions/json-language-features/` as the workspace in VS Code
|
||||||
|
- Run the [`Launch Extension`](https://github.com/Microsoft/vscode/blob/master/extensions/json-language-features/.vscode/launch.json) debug target in the Debug View. This will:
|
||||||
|
- Launch the `preLaunchTask` task to compile the extension
|
||||||
|
- Launch a new VS Code instance with the `json-language-features` extension loaded
|
||||||
|
- You should see a notification saying the development version of `json-language-features` overwrites the bundled version of `json-language-features`
|
||||||
|
- Open a `.json` file to activate the extension. The extension will start the JSON language server process.
|
||||||
|
- Add `"json.trace.server": "verbose"` to the settings to observe the communication between client and server.
|
||||||
|
- Debug the language server process by using `Attach to Node Process` command in the VS Code window opened on `json-language-features`
|
||||||
|
- Run `Reload Window` command in the launched instance to reload the extension
|
||||||
|
|
||||||
|
|
||||||
|
### Contribute to vscode-json-languageservice
|
||||||
|
|
||||||
|
[Microsoft/vscode-json-languageservice](https://github.com/Microsoft/vscode-json-languageservice) is the library that implements the language smarts for JSON.
|
||||||
|
The JSON language server forwards most the of requests to the service library.
|
||||||
|
If you want to fix JSON issues or make improvements, you should make changes at [Microsoft/vscode-json-languageservice](https://github.com/Microsoft/vscode-json-languageservice).
|
||||||
|
|
||||||
|
However, within this extension, you can run a development version of `vscode-json-languageservice` to debug code or test language features interactively:
|
||||||
|
|
||||||
|
#### Linking `vscode-json-languageservice` in `json-language-features/server/`
|
||||||
|
|
||||||
|
- Clone [Microsoft/vscode-json-languageservice](https://github.com/Microsoft/vscode-json-languageservice)
|
||||||
|
- Run `yarn` in `vscode-json-languageservice`
|
||||||
|
- Run `yarn link` in `vscode-json-languageservice`. This will compile and link `vscode-json-languageservice`
|
||||||
|
- In `json-language-features/server/`, run `npm link vscode-json-languageservice`
|
||||||
|
|
||||||
|
#### Testing the development version of `vscode-json-languageservice`
|
||||||
|
|
||||||
|
- Open both `vscode-json-languageservice` and this extension in a single workspace with [multi-root workspace](https://code.visualstudio.com/docs/editor/multi-root-workspaces) feature
|
||||||
|
- Run `yarn watch` at `json-languagefeatures/server/` to recompile this extension with the linked version of `vscode-json-languageservice`
|
||||||
|
- Make some changes in `vscode-json-languageservice`
|
||||||
|
- Now when you run `Launch Extension` debug target, the launched instance will use your development version of `vscode-json-languageservice`. You can interactively test the language features.
|
||||||
@@ -6,9 +6,11 @@
|
|||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as nls from 'vscode-nls';
|
import * as nls from 'vscode-nls';
|
||||||
|
import { xhr, XHRResponse, getErrorStatusDescription } from 'request-light';
|
||||||
|
|
||||||
const localize = nls.loadMessageBundle();
|
const localize = nls.loadMessageBundle();
|
||||||
|
|
||||||
import { workspace, window, languages, commands, ExtensionContext, extensions, Uri, LanguageConfiguration, Diagnostic, StatusBarAlignment, TextEditor, TextDocument, Position, SelectionRange, Range, SelectionRangeKind } from 'vscode';
|
import { workspace, window, languages, commands, ExtensionContext, extensions, Uri, LanguageConfiguration, Diagnostic, StatusBarAlignment, TextEditor, TextDocument, Position, SelectionRange } from 'vscode';
|
||||||
import { LanguageClient, LanguageClientOptions, RequestType, ServerOptions, TransportKind, NotificationType, DidChangeConfigurationNotification, HandleDiagnosticsSignature } from 'vscode-languageclient';
|
import { LanguageClient, LanguageClientOptions, RequestType, ServerOptions, TransportKind, NotificationType, DidChangeConfigurationNotification, HandleDiagnosticsSignature } from 'vscode-languageclient';
|
||||||
import TelemetryReporter from 'vscode-extension-telemetry';
|
import TelemetryReporter from 'vscode-extension-telemetry';
|
||||||
|
|
||||||
@@ -93,6 +95,9 @@ export function activate(context: ExtensionContext) {
|
|||||||
let clientOptions: LanguageClientOptions = {
|
let clientOptions: LanguageClientOptions = {
|
||||||
// Register the server for json documents
|
// Register the server for json documents
|
||||||
documentSelector,
|
documentSelector,
|
||||||
|
initializationOptions: {
|
||||||
|
handledSchemaProtocols: ['file'] // language server only loads file-URI. Fetching schemas with other protocols ('http'...) are made on the client.
|
||||||
|
},
|
||||||
synchronize: {
|
synchronize: {
|
||||||
// Synchronize the setting section 'json' to the server
|
// Synchronize the setting section 'json' to the server
|
||||||
configurationSection: ['json', 'http'],
|
configurationSection: ['json', 'http'],
|
||||||
@@ -138,11 +143,20 @@ export function activate(context: ExtensionContext) {
|
|||||||
// handle content request
|
// handle content request
|
||||||
client.onRequest(VSCodeContentRequest.type, (uriPath: string) => {
|
client.onRequest(VSCodeContentRequest.type, (uriPath: string) => {
|
||||||
let uri = Uri.parse(uriPath);
|
let uri = Uri.parse(uriPath);
|
||||||
|
if (uri.scheme !== 'http' && uri.scheme !== 'https') {
|
||||||
return workspace.openTextDocument(uri).then(doc => {
|
return workspace.openTextDocument(uri).then(doc => {
|
||||||
return doc.getText();
|
return doc.getText();
|
||||||
}, error => {
|
}, error => {
|
||||||
return Promise.reject(error);
|
return Promise.reject(error);
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
const headers = { 'Accept-Encoding': 'gzip, deflate' };
|
||||||
|
return xhr({ url: uriPath, followRedirects: 5, headers }).then(response => {
|
||||||
|
return response.responseText;
|
||||||
|
}, (error: XHRResponse) => {
|
||||||
|
return Promise.reject(error.responseText || getErrorStatusDescription(error.status) || error.toString());
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
let handleContentChange = (uri: Uri) => {
|
let handleContentChange = (uri: Uri) => {
|
||||||
@@ -200,15 +214,17 @@ export function activate(context: ExtensionContext) {
|
|||||||
|
|
||||||
documentSelector.forEach(selector => {
|
documentSelector.forEach(selector => {
|
||||||
toDispose.push(languages.registerSelectionRangeProvider(selector, {
|
toDispose.push(languages.registerSelectionRangeProvider(selector, {
|
||||||
async provideSelectionRanges(document: TextDocument, position: Position): Promise<SelectionRange[]> {
|
async provideSelectionRanges(document: TextDocument, positions: Position[]): Promise<SelectionRange[]> {
|
||||||
const textDocument = client.code2ProtocolConverter.asTextDocumentIdentifier(document);
|
const textDocument = client.code2ProtocolConverter.asTextDocumentIdentifier(document);
|
||||||
const rawRanges = await client.sendRequest<Range[]>('$/textDocument/selectionRange', { textDocument, position });
|
const rawResult = await client.sendRequest<SelectionRange[][]>('$/textDocument/selectionRanges', { textDocument, positions: positions.map(client.code2ProtocolConverter.asPosition) });
|
||||||
if (Array.isArray(rawRanges)) {
|
if (Array.isArray(rawResult)) {
|
||||||
return rawRanges.map(r => {
|
return rawResult.map(rawSelectionRanges => {
|
||||||
|
return rawSelectionRanges.reduceRight((parent: SelectionRange | undefined, selectionRange: SelectionRange) => {
|
||||||
return {
|
return {
|
||||||
range: client.protocol2CodeConverter.asRange(r),
|
range: client.protocol2CodeConverter.asRange(selectionRange.range),
|
||||||
kind: SelectionRangeKind.Declaration
|
parent,
|
||||||
};
|
};
|
||||||
|
}, undefined)!;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return [];
|
return [];
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
const withDefaults = require('../shared.webpack.config');
|
const withDefaults = require('../shared.webpack.config');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
var webpack = require('webpack');
|
||||||
|
|
||||||
module.exports = withDefaults({
|
module.exports = withDefaults({
|
||||||
context: path.join(__dirname, 'client'),
|
context: path.join(__dirname, 'client'),
|
||||||
@@ -18,5 +19,9 @@ module.exports = withDefaults({
|
|||||||
output: {
|
output: {
|
||||||
filename: 'jsonMain.js',
|
filename: 'jsonMain.js',
|
||||||
path: path.join(__dirname, 'client', 'dist')
|
path: path.join(__dirname, 'client', 'dist')
|
||||||
}
|
},
|
||||||
|
plugins: [
|
||||||
|
new webpack.IgnorePlugin(/vertx/) // request-light dependendeny
|
||||||
|
]
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -102,10 +102,11 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"vscode-extension-telemetry": "0.1.1",
|
"vscode-extension-telemetry": "0.1.1",
|
||||||
"vscode-languageclient": "^5.1.0",
|
"vscode-languageclient": "^5.2.1",
|
||||||
"vscode-nls": "^4.0.0"
|
"vscode-nls": "^4.0.0",
|
||||||
|
"request-light": "^0.2.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^8.10.25"
|
"@types/node": "^10.12.21"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------------------------
|
|
||||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
||||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
||||||
*--------------------------------------------------------------------------------------------*/
|
|
||||||
module.exports = {};
|
|
||||||
@@ -21,10 +21,6 @@ module.exports = withDefaults({
|
|||||||
path: path.join(__dirname, 'dist')
|
path: path.join(__dirname, 'dist')
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
new webpack.NormalModuleReplacementPlugin(
|
new webpack.IgnorePlugin(/vertx/) // request-light dependendeny
|
||||||
/[/\\]vscode-languageserver[/\\]lib[/\\]files\.js/,
|
]
|
||||||
require.resolve('./build/filesFillIn')
|
|
||||||
),
|
|
||||||
new webpack.IgnorePlugin(/vertx/)
|
|
||||||
],
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -12,16 +12,16 @@
|
|||||||
},
|
},
|
||||||
"main": "./out/jsonServerMain",
|
"main": "./out/jsonServerMain",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"jsonc-parser": "^2.0.2",
|
"jsonc-parser": "^2.0.3",
|
||||||
"request-light": "^0.2.4",
|
"request-light": "^0.2.4",
|
||||||
"vscode-json-languageservice": "^3.3.0-next.0",
|
"vscode-json-languageservice": "^3.3.0-next.6",
|
||||||
"vscode-languageserver": "^5.1.0",
|
"vscode-languageserver": "^5.3.0-next.2",
|
||||||
"vscode-nls": "^4.0.0",
|
"vscode-nls": "^4.0.0",
|
||||||
"vscode-uri": "^1.0.6"
|
"vscode-uri": "^1.0.6"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/mocha": "2.2.33",
|
"@types/mocha": "2.2.33",
|
||||||
"@types/node": "^8.10.25"
|
"@types/node": "^10.12.21"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepublishOnly": "npm run clean && npm run test",
|
"prepublishOnly": "npm run clean && npm run test",
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import { xhr, XHRResponse, configure as configureHttpRequests, getErrorStatusDes
|
|||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import URI from 'vscode-uri';
|
import URI from 'vscode-uri';
|
||||||
import * as URL from 'url';
|
import * as URL from 'url';
|
||||||
import { startsWith } from './utils/strings';
|
|
||||||
import { formatError, runSafe, runSafeAsync } from './utils/runner';
|
import { formatError, runSafe, runSafeAsync } from './utils/runner';
|
||||||
import { JSONDocument, JSONSchema, getLanguageService, DocumentLanguageSettings, SchemaConfiguration } from 'vscode-json-languageservice';
|
import { JSONDocument, JSONSchema, getLanguageService, DocumentLanguageSettings, SchemaConfiguration } from 'vscode-json-languageservice';
|
||||||
import { getLanguageModelCache } from './languageModelCache';
|
import { getLanguageModelCache } from './languageModelCache';
|
||||||
@@ -57,22 +56,20 @@ const workspaceContext = {
|
|||||||
return URL.resolve(resource, relativePath);
|
return URL.resolve(resource, relativePath);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
function getSchemaRequestService(handledSchemas: { [schema: string]: boolean }) {
|
||||||
|
|
||||||
const schemaRequestService = (uri: string): Thenable<string> => {
|
return (uri: string): Thenable<string> => {
|
||||||
if (startsWith(uri, 'file://')) {
|
const protocol = uri.substr(0, uri.indexOf(':'));
|
||||||
|
|
||||||
|
if (!handledSchemas || handledSchemas[protocol]) {
|
||||||
|
if (protocol === 'file') {
|
||||||
const fsPath = URI.parse(uri).fsPath;
|
const fsPath = URI.parse(uri).fsPath;
|
||||||
return new Promise<string>((c, e) => {
|
return new Promise<string>((c, e) => {
|
||||||
fs.readFile(fsPath, 'UTF-8', (err, result) => {
|
fs.readFile(fsPath, 'UTF-8', (err, result) => {
|
||||||
err ? e(err.message || err.toString()) : c(result.toString());
|
err ? e(err.message || err.toString()) : c(result.toString());
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else if (startsWith(uri, 'vscode://')) {
|
} else if (protocol === 'http' || protocol === 'https') {
|
||||||
return connection.sendRequest(VSCodeContentRequest.type, uri).then(responseText => {
|
|
||||||
return responseText;
|
|
||||||
}, error => {
|
|
||||||
return Promise.reject(error.message);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (uri.indexOf('//schema.management.azure.com/') !== -1) {
|
if (uri.indexOf('//schema.management.azure.com/') !== -1) {
|
||||||
/* __GDPR__
|
/* __GDPR__
|
||||||
"json.schema" : {
|
"json.schema" : {
|
||||||
@@ -92,11 +89,18 @@ const schemaRequestService = (uri: string): Thenable<string> => {
|
|||||||
}, (error: XHRResponse) => {
|
}, (error: XHRResponse) => {
|
||||||
return Promise.reject(error.responseText || getErrorStatusDescription(error.status) || error.toString());
|
return Promise.reject(error.responseText || getErrorStatusDescription(error.status) || error.toString());
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return connection.sendRequest(VSCodeContentRequest.type, uri).then(responseText => {
|
||||||
|
return responseText;
|
||||||
|
}, error => {
|
||||||
|
return Promise.reject(error.message);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// create the JSON language service
|
// create the JSON language service
|
||||||
let languageService = getLanguageService({
|
let languageService = getLanguageService({
|
||||||
schemaRequestService,
|
|
||||||
workspaceContext,
|
workspaceContext,
|
||||||
contributions: [],
|
contributions: [],
|
||||||
});
|
});
|
||||||
@@ -117,8 +121,10 @@ let hierarchicalDocumentSymbolSupport = false;
|
|||||||
// in the passed params the rootPath of the workspace plus the client capabilities.
|
// in the passed params the rootPath of the workspace plus the client capabilities.
|
||||||
connection.onInitialize((params: InitializeParams): InitializeResult => {
|
connection.onInitialize((params: InitializeParams): InitializeResult => {
|
||||||
|
|
||||||
|
const handledProtocols = params.initializationOptions && params.initializationOptions['handledSchemaProtocols'];
|
||||||
|
|
||||||
languageService = getLanguageService({
|
languageService = getLanguageService({
|
||||||
schemaRequestService,
|
schemaRequestService: getSchemaRequestService(handledProtocols),
|
||||||
workspaceContext,
|
workspaceContext,
|
||||||
contributions: [],
|
contributions: [],
|
||||||
clientCapabilities: params.capabilities
|
clientCapabilities: params.capabilities
|
||||||
@@ -427,12 +433,12 @@ connection.onFoldingRanges((params, token) => {
|
|||||||
}, null, `Error while computing folding ranges for ${params.textDocument.uri}`, token);
|
}, null, `Error while computing folding ranges for ${params.textDocument.uri}`, token);
|
||||||
});
|
});
|
||||||
|
|
||||||
connection.onRequest('$/textDocument/selectionRange', async (params, token) => {
|
connection.onRequest('$/textDocument/selectionRanges', async (params, token) => {
|
||||||
return runSafe(() => {
|
return runSafe(() => {
|
||||||
const document = documents.get(params.textDocument.uri);
|
const document = documents.get(params.textDocument.uri);
|
||||||
if (document) {
|
if (document) {
|
||||||
const jsonDocument = getJSONDocument(document);
|
const jsonDocument = getJSONDocument(document);
|
||||||
return languageService.getSelectionRanges(document, params.position, jsonDocument);
|
return languageService.getSelectionRanges(document, params.positions, jsonDocument);
|
||||||
}
|
}
|
||||||
return [];
|
return [];
|
||||||
}, [], `Error while computing selection ranges for ${params.textDocument.uri}`, token);
|
}, [], `Error while computing selection ranges for ${params.textDocument.uri}`, token);
|
||||||
|
|||||||
@@ -3,20 +3,6 @@
|
|||||||
* 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.
|
||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
export function startsWith(haystack: string, needle: string): boolean {
|
|
||||||
if (haystack.length < needle.length) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let i = 0; i < needle.length; i++) {
|
|
||||||
if (haystack[i] !== needle[i]) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines if haystack ends with needle.
|
* Determines if haystack ends with needle.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -7,10 +7,10 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-2.2.33.tgz#d79a0061ec270379f4d9e225f4096fb436669def"
|
resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-2.2.33.tgz#d79a0061ec270379f4d9e225f4096fb436669def"
|
||||||
integrity sha1-15oAYewnA3n02eIl9AlvtDZmne8=
|
integrity sha1-15oAYewnA3n02eIl9AlvtDZmne8=
|
||||||
|
|
||||||
"@types/node@^8.10.25":
|
"@types/node@^10.12.21":
|
||||||
version "8.10.25"
|
version "10.12.21"
|
||||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.25.tgz#801fe4e39372cef18f268db880a5fbfcf71adc7e"
|
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e"
|
||||||
integrity sha512-WXvAXaknB0c2cJ7N44e1kUrVu5K90mSfPPaT5XxfuSMxEWva86EYIwxUZM3jNZ2P1CIC9e2z4WJqpAF69PQxeA==
|
integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ==
|
||||||
|
|
||||||
agent-base@4, agent-base@^4.1.0:
|
agent-base@4, agent-base@^4.1.0:
|
||||||
version "4.1.2"
|
version "4.1.2"
|
||||||
@@ -54,10 +54,10 @@ https-proxy-agent@^2.2.1:
|
|||||||
agent-base "^4.1.0"
|
agent-base "^4.1.0"
|
||||||
debug "^3.1.0"
|
debug "^3.1.0"
|
||||||
|
|
||||||
jsonc-parser@^2.0.2:
|
jsonc-parser@^2.0.3:
|
||||||
version "2.0.2"
|
version "2.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-2.0.2.tgz#42fcf56d70852a043fadafde51ddb4a85649978d"
|
resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-2.0.3.tgz#6d4199ccab7f21ff5d2a4225050c54e981fb21a2"
|
||||||
integrity sha512-TSU435K5tEKh3g7bam1AFf+uZrISheoDsLlpmAo6wWZYqjsnd09lHYK1Qo+moK4Ikifev1Gdpa69g4NELKnCrQ==
|
integrity sha512-WJi9y9ABL01C8CxTKxRRQkkSpY/x2bo4Gy0WuiZGrInxQqgxQpvkBCLNcDYcHOSdhx4ODgbFcgAvfL49C+PHgQ==
|
||||||
|
|
||||||
ms@2.0.0:
|
ms@2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
@@ -73,13 +73,13 @@ request-light@^0.2.4:
|
|||||||
https-proxy-agent "^2.2.1"
|
https-proxy-agent "^2.2.1"
|
||||||
vscode-nls "^4.0.0"
|
vscode-nls "^4.0.0"
|
||||||
|
|
||||||
vscode-json-languageservice@^3.3.0-next.0:
|
vscode-json-languageservice@^3.3.0-next.6:
|
||||||
version "3.3.0-next.0"
|
version "3.3.0-next.6"
|
||||||
resolved "https://registry.yarnpkg.com/vscode-json-languageservice/-/vscode-json-languageservice-3.3.0-next.0.tgz#c17db95d0eacc24f80d3b3f120ab5e03943769a0"
|
resolved "https://registry.yarnpkg.com/vscode-json-languageservice/-/vscode-json-languageservice-3.3.0-next.6.tgz#711f121b44ba443a89f3fb01a01c611f2547079f"
|
||||||
integrity sha512-YZXL3yHzbr0/Ar5dGdeM/f5Y0l41z/Y4QSQTdL3Hl3ScuY76IPcDEnf7iuk9yx+QoPfEHFCBDv5Rg6XVcMl8Tg==
|
integrity sha512-i1tyLiodWc7y6lR9C4cat+OUSptj8Duk1Ybm1FaMzhNfOTFttSiwrBw1otNb+QwI65VEj7EAEBQHRLeQOWznMw==
|
||||||
dependencies:
|
dependencies:
|
||||||
jsonc-parser "^2.0.2"
|
jsonc-parser "^2.0.3"
|
||||||
vscode-languageserver-types "^3.13.0"
|
vscode-languageserver-types "^3.14.0"
|
||||||
vscode-nls "^4.0.0"
|
vscode-nls "^4.0.0"
|
||||||
vscode-uri "^1.0.6"
|
vscode-uri "^1.0.6"
|
||||||
|
|
||||||
@@ -88,25 +88,25 @@ vscode-jsonrpc@^4.0.0:
|
|||||||
resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-4.0.0.tgz#a7bf74ef3254d0a0c272fab15c82128e378b3be9"
|
resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-4.0.0.tgz#a7bf74ef3254d0a0c272fab15c82128e378b3be9"
|
||||||
integrity sha512-perEnXQdQOJMTDFNv+UF3h1Y0z4iSiaN9jIlb0OqIYgosPCZGYh/MCUlkFtV2668PL69lRDO32hmvL2yiidUYg==
|
integrity sha512-perEnXQdQOJMTDFNv+UF3h1Y0z4iSiaN9jIlb0OqIYgosPCZGYh/MCUlkFtV2668PL69lRDO32hmvL2yiidUYg==
|
||||||
|
|
||||||
vscode-languageserver-protocol@3.13.0:
|
vscode-languageserver-protocol@3.15.0-next.1:
|
||||||
version "3.13.0"
|
version "3.15.0-next.1"
|
||||||
resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.13.0.tgz#710d8e42119bb3affb1416e1e104bd6b4d503595"
|
resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.15.0-next.1.tgz#1e45e224d7eef8c79b4bed75b9dcb1930d2ab8ed"
|
||||||
integrity sha512-2ZGKwI+P2ovQll2PGAp+2UfJH+FK9eait86VBUdkPd9HRlm8e58aYT9pV/NYanHOcp3pL6x2yTLVCFMcTer0mg==
|
integrity sha512-LXF0d9s3vxFBxVQ4aKl/XghdEMAncGt3dh4urIYa9Is43g3MfIQL9fC44YZtP+XXOrI2rpZU8lRNN01U1V6CDg==
|
||||||
dependencies:
|
dependencies:
|
||||||
vscode-jsonrpc "^4.0.0"
|
vscode-jsonrpc "^4.0.0"
|
||||||
vscode-languageserver-types "3.13.0"
|
vscode-languageserver-types "3.14.0"
|
||||||
|
|
||||||
vscode-languageserver-types@3.13.0, vscode-languageserver-types@^3.13.0:
|
vscode-languageserver-types@3.14.0, vscode-languageserver-types@^3.14.0:
|
||||||
version "3.13.0"
|
version "3.14.0"
|
||||||
resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.13.0.tgz#b704b024cef059f7b326611c99b9c8753c0a18b4"
|
resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.14.0.tgz#d3b5952246d30e5241592b6dde8280e03942e743"
|
||||||
integrity sha512-BnJIxS+5+8UWiNKCP7W3g9FlE7fErFw0ofP5BXJe7c2tl0VeWh+nNHFbwAS2vmVC4a5kYxHBjRy0UeOtziemVA==
|
integrity sha512-lTmS6AlAlMHOvPQemVwo3CezxBp0sNB95KNPkqp3Nxd5VFEnuG1ByM0zlRWos0zjO3ZWtkvhal0COgiV1xIA4A==
|
||||||
|
|
||||||
vscode-languageserver@^5.1.0:
|
vscode-languageserver@^5.3.0-next.2:
|
||||||
version "5.1.0"
|
version "5.3.0-next.2"
|
||||||
resolved "https://registry.yarnpkg.com/vscode-languageserver/-/vscode-languageserver-5.1.0.tgz#012a28f154cc7a848c443d217894942e4c3eeb39"
|
resolved "https://registry.yarnpkg.com/vscode-languageserver/-/vscode-languageserver-5.3.0-next.2.tgz#31ce4c34d68b517b400ca9e211e43f8d868b8dcc"
|
||||||
integrity sha512-CIsrgx2Y5VHS317g/HwkSTWYBIQmy0DwEyZPmB2pEpVOhYFwVsYpbiJwHIIyLQsQtmRaO4eA2xM8KPjNSdXpBw==
|
integrity sha512-n5onRw9naMrRHp2jnOn+ZwN1n+tTfzftWLPonjp1FWf/iCZWIlnw2TyF/Hn+SDGhLoVtoghmxhwEQaxEAfLHvw==
|
||||||
dependencies:
|
dependencies:
|
||||||
vscode-languageserver-protocol "3.13.0"
|
vscode-languageserver-protocol "3.15.0-next.1"
|
||||||
vscode-uri "^1.0.6"
|
vscode-uri "^1.0.6"
|
||||||
|
|
||||||
vscode-nls@^4.0.0:
|
vscode-nls@^4.0.0:
|
||||||
|
|||||||
@@ -2,10 +2,17 @@
|
|||||||
# yarn lockfile v1
|
# yarn lockfile v1
|
||||||
|
|
||||||
|
|
||||||
"@types/node@^8.10.25":
|
"@types/node@^10.12.21":
|
||||||
version "8.10.25"
|
version "10.12.21"
|
||||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.10.25.tgz#801fe4e39372cef18f268db880a5fbfcf71adc7e"
|
resolved "https://registry.yarnpkg.com/@types/node/-/node-10.12.21.tgz#7e8a0c34cf29f4e17a36e9bd0ea72d45ba03908e"
|
||||||
integrity sha512-WXvAXaknB0c2cJ7N44e1kUrVu5K90mSfPPaT5XxfuSMxEWva86EYIwxUZM3jNZ2P1CIC9e2z4WJqpAF69PQxeA==
|
integrity sha512-CBgLNk4o3XMnqMc0rhb6lc77IwShMEglz05deDcn2lQxyXEZivfwgYJu7SMha9V5XcrP6qZuevTHV/QrN2vjKQ==
|
||||||
|
|
||||||
|
agent-base@4, agent-base@^4.1.0:
|
||||||
|
version "4.2.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9"
|
||||||
|
integrity sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==
|
||||||
|
dependencies:
|
||||||
|
es6-promisify "^5.0.0"
|
||||||
|
|
||||||
applicationinsights@1.0.8:
|
applicationinsights@1.0.8:
|
||||||
version "1.0.8"
|
version "1.0.8"
|
||||||
@@ -16,6 +23,20 @@ applicationinsights@1.0.8:
|
|||||||
diagnostic-channel-publishers "0.2.1"
|
diagnostic-channel-publishers "0.2.1"
|
||||||
zone.js "0.7.6"
|
zone.js "0.7.6"
|
||||||
|
|
||||||
|
debug@3.1.0:
|
||||||
|
version "3.1.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
|
||||||
|
integrity sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==
|
||||||
|
dependencies:
|
||||||
|
ms "2.0.0"
|
||||||
|
|
||||||
|
debug@^3.1.0:
|
||||||
|
version "3.2.6"
|
||||||
|
resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b"
|
||||||
|
integrity sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==
|
||||||
|
dependencies:
|
||||||
|
ms "^2.1.1"
|
||||||
|
|
||||||
diagnostic-channel-publishers@0.2.1:
|
diagnostic-channel-publishers@0.2.1:
|
||||||
version "0.2.1"
|
version "0.2.1"
|
||||||
resolved "https://registry.yarnpkg.com/diagnostic-channel-publishers/-/diagnostic-channel-publishers-0.2.1.tgz#8e2d607a8b6d79fe880b548bc58cc6beb288c4f3"
|
resolved "https://registry.yarnpkg.com/diagnostic-channel-publishers/-/diagnostic-channel-publishers-0.2.1.tgz#8e2d607a8b6d79fe880b548bc58cc6beb288c4f3"
|
||||||
@@ -28,6 +49,53 @@ diagnostic-channel@0.2.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
semver "^5.3.0"
|
semver "^5.3.0"
|
||||||
|
|
||||||
|
es6-promise@^4.0.3:
|
||||||
|
version "4.2.6"
|
||||||
|
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.6.tgz#b685edd8258886365ea62b57d30de28fadcd974f"
|
||||||
|
integrity sha512-aRVgGdnmW2OiySVPUC9e6m+plolMAJKjZnQlCwNSuK5yQ0JN61DZSO1X1Ufd1foqWRAlig0rhduTCHe7sVtK5Q==
|
||||||
|
|
||||||
|
es6-promisify@^5.0.0:
|
||||||
|
version "5.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203"
|
||||||
|
integrity sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=
|
||||||
|
dependencies:
|
||||||
|
es6-promise "^4.0.3"
|
||||||
|
|
||||||
|
http-proxy-agent@^2.1.0:
|
||||||
|
version "2.1.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz#e4821beef5b2142a2026bd73926fe537631c5405"
|
||||||
|
integrity sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==
|
||||||
|
dependencies:
|
||||||
|
agent-base "4"
|
||||||
|
debug "3.1.0"
|
||||||
|
|
||||||
|
https-proxy-agent@^2.2.1:
|
||||||
|
version "2.2.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz#51552970fa04d723e04c56d04178c3f92592bbc0"
|
||||||
|
integrity sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==
|
||||||
|
dependencies:
|
||||||
|
agent-base "^4.1.0"
|
||||||
|
debug "^3.1.0"
|
||||||
|
|
||||||
|
ms@2.0.0:
|
||||||
|
version "2.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
|
||||||
|
integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=
|
||||||
|
|
||||||
|
ms@^2.1.1:
|
||||||
|
version "2.1.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a"
|
||||||
|
integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==
|
||||||
|
|
||||||
|
request-light@^0.2.4:
|
||||||
|
version "0.2.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/request-light/-/request-light-0.2.4.tgz#3cea29c126682e6bcadf7915353322eeba01a755"
|
||||||
|
integrity sha512-pM9Fq5jRnSb+82V7M97rp8FE9/YNeP2L9eckB4Szd7lyeclSIx02aIpPO/6e4m6Dy31+FBN/zkFMTd2HkNO3ow==
|
||||||
|
dependencies:
|
||||||
|
http-proxy-agent "^2.1.0"
|
||||||
|
https-proxy-agent "^2.2.1"
|
||||||
|
vscode-nls "^4.0.0"
|
||||||
|
|
||||||
semver@^5.3.0:
|
semver@^5.3.0:
|
||||||
version "5.5.0"
|
version "5.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab"
|
resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab"
|
||||||
@@ -50,26 +118,26 @@ vscode-jsonrpc@^4.0.0:
|
|||||||
resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-4.0.0.tgz#a7bf74ef3254d0a0c272fab15c82128e378b3be9"
|
resolved "https://registry.yarnpkg.com/vscode-jsonrpc/-/vscode-jsonrpc-4.0.0.tgz#a7bf74ef3254d0a0c272fab15c82128e378b3be9"
|
||||||
integrity sha512-perEnXQdQOJMTDFNv+UF3h1Y0z4iSiaN9jIlb0OqIYgosPCZGYh/MCUlkFtV2668PL69lRDO32hmvL2yiidUYg==
|
integrity sha512-perEnXQdQOJMTDFNv+UF3h1Y0z4iSiaN9jIlb0OqIYgosPCZGYh/MCUlkFtV2668PL69lRDO32hmvL2yiidUYg==
|
||||||
|
|
||||||
vscode-languageclient@^5.1.0:
|
vscode-languageclient@^5.2.1:
|
||||||
version "5.1.0"
|
version "5.2.1"
|
||||||
resolved "https://registry.yarnpkg.com/vscode-languageclient/-/vscode-languageclient-5.1.0.tgz#650ab0dc9fd0daaade058a8471aaff5bc3f9580e"
|
resolved "https://registry.yarnpkg.com/vscode-languageclient/-/vscode-languageclient-5.2.1.tgz#7cfc83a294c409f58cfa2b910a8cfeaad0397193"
|
||||||
integrity sha512-Z95Kps8UqD4o17HE3uCkZuvenOsxHVH46dKmaGVpGixEFZigPaVuVxLM/JWeIY9aRenoC0ZD9CK1O7L4jpffKg==
|
integrity sha512-7jrS/9WnV0ruqPamN1nE7qCxn0phkH5LjSgSp9h6qoJGoeAKzwKz/PF6M+iGA/aklx4GLZg1prddhEPQtuXI1Q==
|
||||||
dependencies:
|
dependencies:
|
||||||
semver "^5.5.0"
|
semver "^5.5.0"
|
||||||
vscode-languageserver-protocol "3.13.0"
|
vscode-languageserver-protocol "3.14.1"
|
||||||
|
|
||||||
vscode-languageserver-protocol@3.13.0:
|
vscode-languageserver-protocol@3.14.1:
|
||||||
version "3.13.0"
|
version "3.14.1"
|
||||||
resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.13.0.tgz#710d8e42119bb3affb1416e1e104bd6b4d503595"
|
resolved "https://registry.yarnpkg.com/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.14.1.tgz#b8aab6afae2849c84a8983d39a1cf742417afe2f"
|
||||||
integrity sha512-2ZGKwI+P2ovQll2PGAp+2UfJH+FK9eait86VBUdkPd9HRlm8e58aYT9pV/NYanHOcp3pL6x2yTLVCFMcTer0mg==
|
integrity sha512-IL66BLb2g20uIKog5Y2dQ0IiigW0XKrvmWiOvc0yXw80z3tMEzEnHjaGAb3ENuU7MnQqgnYJ1Cl2l9RvNgDi4g==
|
||||||
dependencies:
|
dependencies:
|
||||||
vscode-jsonrpc "^4.0.0"
|
vscode-jsonrpc "^4.0.0"
|
||||||
vscode-languageserver-types "3.13.0"
|
vscode-languageserver-types "3.14.0"
|
||||||
|
|
||||||
vscode-languageserver-types@3.13.0:
|
vscode-languageserver-types@3.14.0:
|
||||||
version "3.13.0"
|
version "3.14.0"
|
||||||
resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.13.0.tgz#b704b024cef059f7b326611c99b9c8753c0a18b4"
|
resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.14.0.tgz#d3b5952246d30e5241592b6dde8280e03942e743"
|
||||||
integrity sha512-BnJIxS+5+8UWiNKCP7W3g9FlE7fErFw0ofP5BXJe7c2tl0VeWh+nNHFbwAS2vmVC4a5kYxHBjRy0UeOtziemVA==
|
integrity sha512-lTmS6AlAlMHOvPQemVwo3CezxBp0sNB95KNPkqp3Nxd5VFEnuG1ByM0zlRWos0zjO3ZWtkvhal0COgiV1xIA4A==
|
||||||
|
|
||||||
vscode-nls@^4.0.0:
|
vscode-nls@^4.0.0:
|
||||||
version "4.0.0"
|
version "4.0.0"
|
||||||
|
|||||||
@@ -24,11 +24,13 @@
|
|||||||
".jshintrc",
|
".jshintrc",
|
||||||
".jscsrc",
|
".jscsrc",
|
||||||
".eslintrc",
|
".eslintrc",
|
||||||
|
".swcrc",
|
||||||
".webmanifest",
|
".webmanifest",
|
||||||
".js.map",
|
".js.map",
|
||||||
".css.map"
|
".css.map"
|
||||||
],
|
],
|
||||||
"filenames": [
|
"filenames": [
|
||||||
|
"composer.lock",
|
||||||
".watchmanconfig",
|
".watchmanconfig",
|
||||||
".ember-cli"
|
".ember-cli"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,28 +1,5 @@
|
|||||||
{
|
{
|
||||||
"registrations": [
|
"registrations": [
|
||||||
{
|
|
||||||
"component": {
|
|
||||||
"type": "git",
|
|
||||||
"git": {
|
|
||||||
"name": "chriskempson/tomorrow-theme",
|
|
||||||
"repositoryUrl": "https://github.com/chriskempson/tomorrow-theme",
|
|
||||||
"commitHash": "0e0d35ac303f99b8aa182091ebeaee81cf2183a0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"licenseDetail": [
|
|
||||||
"Copyright (C) 2013 Chris Kempson",
|
|
||||||
"",
|
|
||||||
"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."
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
|
||||||
"version": "0.0.0"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"component": {
|
"component": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -160,6 +160,14 @@
|
|||||||
"command": "markdown.preview.toggleLock",
|
"command": "markdown.preview.toggleLock",
|
||||||
"when": "markdownPreviewFocus"
|
"when": "markdownPreviewFocus"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"command": "markdown.preview.refresh",
|
||||||
|
"when": "editorLangId == markdown"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "markdown.preview.refresh",
|
||||||
|
"when": "markdownPreviewFocus"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"command": "notebook.showPreview",
|
"command": "notebook.showPreview",
|
||||||
"when": "false"
|
"when": "false"
|
||||||
@@ -315,12 +323,12 @@
|
|||||||
"@types/highlight.js": "9.12.3",
|
"@types/highlight.js": "9.12.3",
|
||||||
"@types/lodash.throttle": "^4.1.3",
|
"@types/lodash.throttle": "^4.1.3",
|
||||||
"@types/markdown-it": "0.0.2",
|
"@types/markdown-it": "0.0.2",
|
||||||
"@types/node": "^8.10.25",
|
"@types/node": "^10.12.21",
|
||||||
"lodash.throttle": "^4.1.1",
|
"lodash.throttle": "^4.1.1",
|
||||||
"mocha-junit-reporter": "^1.17.0",
|
"mocha-junit-reporter": "^1.17.0",
|
||||||
"mocha-multi-reporters": "^1.1.7",
|
"mocha-multi-reporters": "^1.1.7",
|
||||||
"ts-loader": "^4.0.1",
|
"ts-loader": "^4.0.1",
|
||||||
"typescript": "^2.7.2",
|
"typescript": "^3.3.1",
|
||||||
"vscode": "^1.1.10",
|
"vscode": "^1.1.10",
|
||||||
"webpack": "^4.1.0",
|
"webpack": "^4.1.0",
|
||||||
"webpack-cli": "^2.0.10"
|
"webpack-cli": "^2.0.10"
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
export function onceDocumentLoaded(f: () => void) {
|
export function onceDocumentLoaded(f: () => void) {
|
||||||
if (document.readyState === 'loading' || document.readyState === 'uninitialized') {
|
if (document.readyState === 'loading' || document.readyState as string === 'uninitialized') {
|
||||||
document.addEventListener('DOMContentLoaded', f);
|
document.addEventListener('DOMContentLoaded', f);
|
||||||
} else {
|
} else {
|
||||||
f();
|
f();
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ const settings = getSettings();
|
|||||||
const vscode = acquireVsCodeApi();
|
const vscode = acquireVsCodeApi();
|
||||||
|
|
||||||
// Set VS Code state
|
// Set VS Code state
|
||||||
const state = getData('data-state');
|
let state = getData('data-state');
|
||||||
vscode.setState(state);
|
vscode.setState(state);
|
||||||
|
|
||||||
const messaging = createPosterForVsCode(vscode);
|
const messaging = createPosterForVsCode(vscode);
|
||||||
@@ -152,6 +152,8 @@ if (settings.scrollEditorWithPreview) {
|
|||||||
const line = getEditorLineNumberForPageOffset(window.scrollY);
|
const line = getEditorLineNumberForPageOffset(window.scrollY);
|
||||||
if (typeof line === 'number' && !isNaN(line)) {
|
if (typeof line === 'number' && !isNaN(line)) {
|
||||||
messaging.postMessage('revealLine', { line });
|
messaging.postMessage('revealLine', { line });
|
||||||
|
state.line = line;
|
||||||
|
vscode.setState(state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, 50));
|
}, 50));
|
||||||
|
|||||||
@@ -24,13 +24,13 @@ const getCodeLineElements = (() => {
|
|||||||
let elements: CodeLineElement[];
|
let elements: CodeLineElement[];
|
||||||
return () => {
|
return () => {
|
||||||
if (!elements) {
|
if (!elements) {
|
||||||
elements = ([{ element: document.body, line: 0 }]).concat(Array.prototype.map.call(
|
elements = [{ element: document.body, line: 0 }];
|
||||||
document.getElementsByClassName('code-line'),
|
for (const element of document.getElementsByClassName('code-line')) {
|
||||||
(element: any) => {
|
const line = +element.getAttribute('data-line')!;
|
||||||
const line = +element.getAttribute('data-line');
|
if (!isNaN(line)) {
|
||||||
return { element, line };
|
elements.push({ element: element as HTMLElement, line });
|
||||||
})
|
}
|
||||||
.filter((x: any) => !isNaN(x.line)));
|
}
|
||||||
}
|
}
|
||||||
return elements;
|
return elements;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
"jsx": "react",
|
"jsx": "react",
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"strict": true,
|
"strict": true,
|
||||||
|
"strictBindCallApply": true,
|
||||||
"noImplicitAny": true,
|
"noImplicitAny": true,
|
||||||
"noUnusedLocals": true
|
"noUnusedLocals": true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ import MarkdownWorkspaceSymbolProvider from './features/workspaceSymbolProvider'
|
|||||||
import { Logger } from './logger';
|
import { Logger } from './logger';
|
||||||
import { MarkdownEngine } from './markdownEngine';
|
import { MarkdownEngine } from './markdownEngine';
|
||||||
import { getMarkdownExtensionContributions } from './markdownExtensions';
|
import { getMarkdownExtensionContributions } from './markdownExtensions';
|
||||||
import { ExtensionContentSecurityPolicyArbiter, PreviewSecuritySelector } from './security';
|
import { ExtensionContentSecurityPolicyArbiter, PreviewSecuritySelector, ContentSecurityPolicyArbiter } from './security';
|
||||||
import { loadDefaultTelemetryReporter } from './telemetryReporter';
|
import { loadDefaultTelemetryReporter, TelemetryReporter } from './telemetryReporter';
|
||||||
import { githubSlugifier } from './slugify';
|
import { githubSlugifier } from './slugify';
|
||||||
|
|
||||||
|
|
||||||
@@ -25,33 +25,55 @@ export function activate(context: vscode.ExtensionContext) {
|
|||||||
context.subscriptions.push(telemetryReporter);
|
context.subscriptions.push(telemetryReporter);
|
||||||
|
|
||||||
const contributions = getMarkdownExtensionContributions(context);
|
const contributions = getMarkdownExtensionContributions(context);
|
||||||
|
context.subscriptions.push(contributions);
|
||||||
|
|
||||||
const cspArbiter = new ExtensionContentSecurityPolicyArbiter(context.globalState, context.workspaceState);
|
const cspArbiter = new ExtensionContentSecurityPolicyArbiter(context.globalState, context.workspaceState);
|
||||||
const engine = new MarkdownEngine(contributions, githubSlugifier);
|
const engine = new MarkdownEngine(contributions, githubSlugifier);
|
||||||
const logger = new Logger();
|
const logger = new Logger();
|
||||||
|
|
||||||
const selector: vscode.DocumentSelector = [
|
|
||||||
{ language: 'markdown', scheme: 'file' },
|
|
||||||
{ language: 'markdown', scheme: 'untitled' }
|
|
||||||
];
|
|
||||||
|
|
||||||
const contentProvider = new MarkdownContentProvider(engine, context, cspArbiter, contributions, logger);
|
const contentProvider = new MarkdownContentProvider(engine, context, cspArbiter, contributions, logger);
|
||||||
const symbolProvider = new MDDocumentSymbolProvider(engine);
|
const symbolProvider = new MDDocumentSymbolProvider(engine);
|
||||||
const previewManager = new MarkdownPreviewManager(contentProvider, logger, contributions);
|
const previewManager = new MarkdownPreviewManager(contentProvider, logger, contributions);
|
||||||
context.subscriptions.push(previewManager);
|
context.subscriptions.push(previewManager);
|
||||||
|
|
||||||
context.subscriptions.push(vscode.languages.setLanguageConfiguration('markdown', {
|
context.subscriptions.push(registerMarkdownLanguageFeatures(symbolProvider, engine));
|
||||||
wordPattern: new RegExp('(\\p{Alphabetic}|\\p{Number})+', 'ug'),
|
context.subscriptions.push(registerMarkdownCommands(previewManager, telemetryReporter, cspArbiter, engine));
|
||||||
}));
|
|
||||||
context.subscriptions.push(vscode.languages.registerDocumentSymbolProvider(selector, symbolProvider));
|
|
||||||
context.subscriptions.push(vscode.languages.registerDocumentLinkProvider(selector, new LinkProvider()));
|
|
||||||
context.subscriptions.push(vscode.languages.registerFoldingRangeProvider(selector, new MarkdownFoldingProvider(engine)));
|
|
||||||
context.subscriptions.push(vscode.languages.registerWorkspaceSymbolProvider(new MarkdownWorkspaceSymbolProvider(symbolProvider)));
|
|
||||||
|
|
||||||
|
context.subscriptions.push(vscode.workspace.onDidChangeConfiguration(() => {
|
||||||
|
logger.updateConfiguration();
|
||||||
|
previewManager.updateConfiguration();
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
function registerMarkdownLanguageFeatures(
|
||||||
|
symbolProvider: MDDocumentSymbolProvider,
|
||||||
|
engine: MarkdownEngine
|
||||||
|
): vscode.Disposable {
|
||||||
|
const selector: vscode.DocumentSelector = [
|
||||||
|
{ language: 'markdown', scheme: 'file' },
|
||||||
|
{ language: 'markdown', scheme: 'untitled' }
|
||||||
|
];
|
||||||
|
|
||||||
|
return vscode.Disposable.from(
|
||||||
|
vscode.languages.setLanguageConfiguration('markdown', {
|
||||||
|
wordPattern: new RegExp('(\\p{Alphabetic}|\\p{Number})+', 'ug'),
|
||||||
|
}),
|
||||||
|
vscode.languages.registerDocumentSymbolProvider(selector, symbolProvider),
|
||||||
|
vscode.languages.registerDocumentLinkProvider(selector, new LinkProvider()),
|
||||||
|
vscode.languages.registerFoldingRangeProvider(selector, new MarkdownFoldingProvider(engine)),
|
||||||
|
vscode.languages.registerWorkspaceSymbolProvider(new MarkdownWorkspaceSymbolProvider(symbolProvider))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function registerMarkdownCommands(
|
||||||
|
previewManager: MarkdownPreviewManager,
|
||||||
|
telemetryReporter: TelemetryReporter,
|
||||||
|
cspArbiter: ContentSecurityPolicyArbiter,
|
||||||
|
engine: MarkdownEngine
|
||||||
|
): vscode.Disposable {
|
||||||
const previewSecuritySelector = new PreviewSecuritySelector(cspArbiter, previewManager);
|
const previewSecuritySelector = new PreviewSecuritySelector(cspArbiter, previewManager);
|
||||||
|
|
||||||
const commandManager = new CommandManager();
|
const commandManager = new CommandManager();
|
||||||
context.subscriptions.push(commandManager);
|
|
||||||
commandManager.register(new commands.ShowPreviewCommand(previewManager, telemetryReporter));
|
commandManager.register(new commands.ShowPreviewCommand(previewManager, telemetryReporter));
|
||||||
commandManager.register(new commands.ShowPreviewToSideCommand(previewManager, telemetryReporter));
|
commandManager.register(new commands.ShowPreviewToSideCommand(previewManager, telemetryReporter));
|
||||||
commandManager.register(new commands.ShowLockedPreviewToSideCommand(previewManager, telemetryReporter));
|
commandManager.register(new commands.ShowLockedPreviewToSideCommand(previewManager, telemetryReporter));
|
||||||
@@ -63,9 +85,5 @@ export function activate(context: vscode.ExtensionContext) {
|
|||||||
commandManager.register(new commands.ToggleLockCommand(previewManager));
|
commandManager.register(new commands.ToggleLockCommand(previewManager));
|
||||||
// {{SQL CARBON EDIT}}
|
// {{SQL CARBON EDIT}}
|
||||||
commandManager.register(new commands.ShowNotebookPreview(engine));
|
commandManager.register(new commands.ShowNotebookPreview(engine));
|
||||||
|
return commandManager;
|
||||||
context.subscriptions.push(vscode.workspace.onDidChangeConfiguration(() => {
|
|
||||||
logger.updateConfiguration();
|
|
||||||
previewManager.updateConfiguration();
|
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,12 +8,12 @@ import * as path from 'path';
|
|||||||
|
|
||||||
import { Logger } from '../logger';
|
import { Logger } from '../logger';
|
||||||
import { MarkdownContentProvider } from './previewContentProvider';
|
import { MarkdownContentProvider } from './previewContentProvider';
|
||||||
import { disposeAll } from '../util/dispose';
|
import { Disposable } from '../util/dispose';
|
||||||
|
|
||||||
import * as nls from 'vscode-nls';
|
import * as nls from 'vscode-nls';
|
||||||
import { getVisibleLine, MarkdownFileTopmostLineMonitor } from '../util/topmostLineMonitor';
|
import { getVisibleLine, MarkdownFileTopmostLineMonitor } from '../util/topmostLineMonitor';
|
||||||
import { MarkdownPreviewConfigurationManager } from './previewConfig';
|
import { MarkdownPreviewConfigurationManager } from './previewConfig';
|
||||||
import { MarkdownContributions } from '../markdownExtensions';
|
import { MarkdownContributionProvider, MarkdownContributions } from '../markdownExtensions';
|
||||||
import { isMarkdownFile } from '../util/file';
|
import { isMarkdownFile } from '../util/file';
|
||||||
import { resolveLinkToMarkdownFile } from '../commands/openDocumentLink';
|
import { resolveLinkToMarkdownFile } from '../commands/openDocumentLink';
|
||||||
const localize = nls.loadMessageBundle();
|
const localize = nls.loadMessageBundle();
|
||||||
@@ -60,7 +60,7 @@ interface PreviewStyleLoadErrorMessage extends WebviewMessage {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export class MarkdownPreview {
|
export class MarkdownPreview extends Disposable {
|
||||||
|
|
||||||
public static viewType = 'markdown.preview';
|
public static viewType = 'markdown.preview';
|
||||||
|
|
||||||
@@ -70,7 +70,6 @@ export class MarkdownPreview {
|
|||||||
private readonly editor: vscode.WebviewPanel;
|
private readonly editor: vscode.WebviewPanel;
|
||||||
private throttleTimer: any;
|
private throttleTimer: any;
|
||||||
private line: number | undefined = undefined;
|
private line: number | undefined = undefined;
|
||||||
private readonly disposables: vscode.Disposable[] = [];
|
|
||||||
private firstUpdate = true;
|
private firstUpdate = true;
|
||||||
private currentVersion?: { resource: vscode.Uri, version: number };
|
private currentVersion?: { resource: vscode.Uri, version: number };
|
||||||
private forceUpdate = false;
|
private forceUpdate = false;
|
||||||
@@ -85,7 +84,7 @@ export class MarkdownPreview {
|
|||||||
previewConfigurations: MarkdownPreviewConfigurationManager,
|
previewConfigurations: MarkdownPreviewConfigurationManager,
|
||||||
logger: Logger,
|
logger: Logger,
|
||||||
topmostLineMonitor: MarkdownFileTopmostLineMonitor,
|
topmostLineMonitor: MarkdownFileTopmostLineMonitor,
|
||||||
contributions: MarkdownContributions,
|
contributionProvider: MarkdownContributionProvider,
|
||||||
): Promise<MarkdownPreview> {
|
): Promise<MarkdownPreview> {
|
||||||
const resource = vscode.Uri.parse(state.resource);
|
const resource = vscode.Uri.parse(state.resource);
|
||||||
const locked = state.locked;
|
const locked = state.locked;
|
||||||
@@ -99,9 +98,9 @@ export class MarkdownPreview {
|
|||||||
previewConfigurations,
|
previewConfigurations,
|
||||||
logger,
|
logger,
|
||||||
topmostLineMonitor,
|
topmostLineMonitor,
|
||||||
contributions);
|
contributionProvider);
|
||||||
|
|
||||||
preview.editor.webview.options = MarkdownPreview.getWebviewOptions(resource, contributions);
|
preview.editor.webview.options = MarkdownPreview.getWebviewOptions(resource, contributionProvider.contributions);
|
||||||
|
|
||||||
if (!isNaN(line)) {
|
if (!isNaN(line)) {
|
||||||
preview.line = line;
|
preview.line = line;
|
||||||
@@ -118,14 +117,14 @@ export class MarkdownPreview {
|
|||||||
previewConfigurations: MarkdownPreviewConfigurationManager,
|
previewConfigurations: MarkdownPreviewConfigurationManager,
|
||||||
logger: Logger,
|
logger: Logger,
|
||||||
topmostLineMonitor: MarkdownFileTopmostLineMonitor,
|
topmostLineMonitor: MarkdownFileTopmostLineMonitor,
|
||||||
contributions: MarkdownContributions
|
contributionProvider: MarkdownContributionProvider
|
||||||
): MarkdownPreview {
|
): MarkdownPreview {
|
||||||
const webview = vscode.window.createWebviewPanel(
|
const webview = vscode.window.createWebviewPanel(
|
||||||
MarkdownPreview.viewType,
|
MarkdownPreview.viewType,
|
||||||
MarkdownPreview.getPreviewTitle(resource, locked),
|
MarkdownPreview.getPreviewTitle(resource, locked),
|
||||||
previewColumn, {
|
previewColumn, {
|
||||||
enableFindWidget: true,
|
enableFindWidget: true,
|
||||||
...MarkdownPreview.getWebviewOptions(resource, contributions)
|
...MarkdownPreview.getWebviewOptions(resource, contributionProvider.contributions)
|
||||||
});
|
});
|
||||||
|
|
||||||
return new MarkdownPreview(
|
return new MarkdownPreview(
|
||||||
@@ -136,7 +135,7 @@ export class MarkdownPreview {
|
|||||||
previewConfigurations,
|
previewConfigurations,
|
||||||
logger,
|
logger,
|
||||||
topmostLineMonitor,
|
topmostLineMonitor,
|
||||||
contributions);
|
contributionProvider);
|
||||||
}
|
}
|
||||||
|
|
||||||
private constructor(
|
private constructor(
|
||||||
@@ -147,19 +146,24 @@ export class MarkdownPreview {
|
|||||||
private readonly _previewConfigurations: MarkdownPreviewConfigurationManager,
|
private readonly _previewConfigurations: MarkdownPreviewConfigurationManager,
|
||||||
private readonly _logger: Logger,
|
private readonly _logger: Logger,
|
||||||
topmostLineMonitor: MarkdownFileTopmostLineMonitor,
|
topmostLineMonitor: MarkdownFileTopmostLineMonitor,
|
||||||
private readonly _contributions: MarkdownContributions,
|
private readonly _contributionProvider: MarkdownContributionProvider,
|
||||||
) {
|
) {
|
||||||
|
super();
|
||||||
this._resource = resource;
|
this._resource = resource;
|
||||||
this._locked = locked;
|
this._locked = locked;
|
||||||
this.editor = webview;
|
this.editor = webview;
|
||||||
|
|
||||||
this.editor.onDidDispose(() => {
|
this.editor.onDidDispose(() => {
|
||||||
this.dispose();
|
this.dispose();
|
||||||
}, null, this.disposables);
|
}, null, this._disposables);
|
||||||
|
|
||||||
this.editor.onDidChangeViewState(e => {
|
this.editor.onDidChangeViewState(e => {
|
||||||
this._onDidChangeViewStateEmitter.fire(e);
|
this._onDidChangeViewStateEmitter.fire(e);
|
||||||
}, null, this.disposables);
|
}, null, this._disposables);
|
||||||
|
|
||||||
|
_contributionProvider.onContributionsChanged(() => {
|
||||||
|
setImmediate(() => this.refresh());
|
||||||
|
}, null, this._disposables);
|
||||||
|
|
||||||
this.editor.webview.onDidReceiveMessage((e: CacheImageSizesMessage | RevealLineMessage | DidClickMessage | ClickLinkMessage | ShowPreviewSecuritySelectorMessage | PreviewStyleLoadErrorMessage) => {
|
this.editor.webview.onDidReceiveMessage((e: CacheImageSizesMessage | RevealLineMessage | DidClickMessage | ClickLinkMessage | ShowPreviewSecuritySelectorMessage | PreviewStyleLoadErrorMessage) => {
|
||||||
if (e.source !== this._resource.toString()) {
|
if (e.source !== this._resource.toString()) {
|
||||||
@@ -191,19 +195,19 @@ export class MarkdownPreview {
|
|||||||
vscode.window.showWarningMessage(localize('onPreviewStyleLoadError', "Could not load 'markdown.styles': {0}", e.body.unloadedStyles.join(', ')));
|
vscode.window.showWarningMessage(localize('onPreviewStyleLoadError', "Could not load 'markdown.styles': {0}", e.body.unloadedStyles.join(', ')));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}, null, this.disposables);
|
}, null, this._disposables);
|
||||||
|
|
||||||
vscode.workspace.onDidChangeTextDocument(event => {
|
vscode.workspace.onDidChangeTextDocument(event => {
|
||||||
if (this.isPreviewOf(event.document.uri)) {
|
if (this.isPreviewOf(event.document.uri)) {
|
||||||
this.refresh();
|
this.refresh();
|
||||||
}
|
}
|
||||||
}, null, this.disposables);
|
}, null, this._disposables);
|
||||||
|
|
||||||
topmostLineMonitor.onDidChangeTopmostLine(event => {
|
topmostLineMonitor.onDidChangeTopmostLine(event => {
|
||||||
if (this.isPreviewOf(event.resource)) {
|
if (this.isPreviewOf(event.resource)) {
|
||||||
this.updateForView(event.resource, event.line);
|
this.updateForView(event.resource, event.line);
|
||||||
}
|
}
|
||||||
}, null, this.disposables);
|
}, null, this._disposables);
|
||||||
|
|
||||||
vscode.window.onDidChangeTextEditorSelection(event => {
|
vscode.window.onDidChangeTextEditorSelection(event => {
|
||||||
if (this.isPreviewOf(event.textEditor.document.uri)) {
|
if (this.isPreviewOf(event.textEditor.document.uri)) {
|
||||||
@@ -213,13 +217,13 @@ export class MarkdownPreview {
|
|||||||
source: this.resource.toString()
|
source: this.resource.toString()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, null, this.disposables);
|
}, null, this._disposables);
|
||||||
|
|
||||||
vscode.window.onDidChangeActiveTextEditor(editor => {
|
vscode.window.onDidChangeActiveTextEditor(editor => {
|
||||||
if (editor && isMarkdownFile(editor.document) && !this._locked) {
|
if (editor && isMarkdownFile(editor.document) && !this._locked) {
|
||||||
this.update(editor.document.uri);
|
this.update(editor.document.uri);
|
||||||
}
|
}
|
||||||
}, null, this.disposables);
|
}, null, this._disposables);
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly _onDisposeEmitter = new vscode.EventEmitter<void>();
|
private readonly _onDisposeEmitter = new vscode.EventEmitter<void>();
|
||||||
@@ -242,18 +246,17 @@ export class MarkdownPreview {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public dispose() {
|
public dispose() {
|
||||||
|
super.dispose();
|
||||||
if (this._disposed) {
|
if (this._disposed) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._disposed = true;
|
this._disposed = true;
|
||||||
this._onDisposeEmitter.fire();
|
this._onDisposeEmitter.fire();
|
||||||
|
|
||||||
this._onDisposeEmitter.dispose();
|
this._onDisposeEmitter.dispose();
|
||||||
|
|
||||||
this._onDidChangeViewStateEmitter.dispose();
|
this._onDidChangeViewStateEmitter.dispose();
|
||||||
this.editor.dispose();
|
this.editor.dispose();
|
||||||
|
|
||||||
disposeAll(this.disposables);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public update(resource: vscode.Uri) {
|
public update(resource: vscode.Uri) {
|
||||||
@@ -328,7 +331,7 @@ export class MarkdownPreview {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private get iconPath() {
|
private get iconPath() {
|
||||||
const root = path.join(this._contributions.extensionPath, 'media');
|
const root = path.join(this._contributionProvider.extensionPath, 'media');
|
||||||
return {
|
return {
|
||||||
light: vscode.Uri.file(path.join(root, 'Preview.svg')),
|
light: vscode.Uri.file(path.join(root, 'Preview.svg')),
|
||||||
dark: vscode.Uri.file(path.join(root, 'Preview_inverse.svg'))
|
dark: vscode.Uri.file(path.join(root, 'Preview_inverse.svg'))
|
||||||
@@ -392,7 +395,7 @@ export class MarkdownPreview {
|
|||||||
if (this._resource === resource) {
|
if (this._resource === resource) {
|
||||||
this.editor.title = MarkdownPreview.getPreviewTitle(this._resource, this._locked);
|
this.editor.title = MarkdownPreview.getPreviewTitle(this._resource, this._locked);
|
||||||
this.editor.iconPath = this.iconPath;
|
this.editor.iconPath = this.iconPath;
|
||||||
this.editor.webview.options = MarkdownPreview.getWebviewOptions(resource, this._contributions);
|
this.editor.webview.options = MarkdownPreview.getWebviewOptions(resource, this._contributionProvider.contributions);
|
||||||
this.editor.webview.html = content;
|
this.editor.webview.html = content;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -410,7 +413,7 @@ export class MarkdownPreview {
|
|||||||
private static getLocalResourceRoots(
|
private static getLocalResourceRoots(
|
||||||
resource: vscode.Uri,
|
resource: vscode.Uri,
|
||||||
contributions: MarkdownContributions
|
contributions: MarkdownContributions
|
||||||
): vscode.Uri[] {
|
): ReadonlyArray<vscode.Uri> {
|
||||||
const baseRoots = contributions.previewResourceRoots;
|
const baseRoots = contributions.previewResourceRoots;
|
||||||
|
|
||||||
const folder = vscode.workspace.getWorkspaceFolder(resource);
|
const folder = vscode.workspace.getWorkspaceFolder(resource);
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ const localize = nls.loadMessageBundle();
|
|||||||
import { Logger } from '../logger';
|
import { Logger } from '../logger';
|
||||||
import { ContentSecurityPolicyArbiter, MarkdownPreviewSecurityLevel } from '../security';
|
import { ContentSecurityPolicyArbiter, MarkdownPreviewSecurityLevel } from '../security';
|
||||||
import { MarkdownPreviewConfigurationManager, MarkdownPreviewConfiguration } from './previewConfig';
|
import { MarkdownPreviewConfigurationManager, MarkdownPreviewConfiguration } from './previewConfig';
|
||||||
import { MarkdownContributions } from '../markdownExtensions';
|
import { MarkdownContributionProvider } from '../markdownExtensions';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Strings used inside the markdown preview.
|
* Strings used inside the markdown preview.
|
||||||
@@ -40,7 +40,7 @@ export class MarkdownContentProvider {
|
|||||||
private readonly engine: MarkdownEngine,
|
private readonly engine: MarkdownEngine,
|
||||||
private readonly context: vscode.ExtensionContext,
|
private readonly context: vscode.ExtensionContext,
|
||||||
private readonly cspArbiter: ContentSecurityPolicyArbiter,
|
private readonly cspArbiter: ContentSecurityPolicyArbiter,
|
||||||
private readonly contributions: MarkdownContributions,
|
private readonly contributionProvider: MarkdownContributionProvider,
|
||||||
private readonly logger: Logger
|
private readonly logger: Logger
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
@@ -163,7 +163,7 @@ export class MarkdownContentProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private getStyles(resource: vscode.Uri, nonce: string, config: MarkdownPreviewConfiguration, state?: any): string {
|
private getStyles(resource: vscode.Uri, nonce: string, config: MarkdownPreviewConfiguration, state?: any): string {
|
||||||
const baseStyles = this.contributions.previewStyles
|
const baseStyles = this.contributionProvider.contributions.previewStyles
|
||||||
.map(resource => `<link rel="stylesheet" type="text/css" href="${resource.toString()}">`)
|
.map(resource => `<link rel="stylesheet" type="text/css" href="${resource.toString()}">`)
|
||||||
.join('\n');
|
.join('\n');
|
||||||
|
|
||||||
@@ -174,7 +174,7 @@ export class MarkdownContentProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private getScripts(nonce: string): string {
|
private getScripts(nonce: string): string {
|
||||||
return this.contributions.previewScripts
|
return this.contributionProvider.contributions.previewScripts
|
||||||
.map(resource => `<script async src="${resource.toString()}" nonce="${nonce}" charset="UTF-8"></script>`)
|
.map(resource => `<script async src="${resource.toString()}" nonce="${nonce}" charset="UTF-8"></script>`)
|
||||||
.join('\n');
|
.join('\n');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
import { Logger } from '../logger';
|
import { Logger } from '../logger';
|
||||||
import { MarkdownContributions } from '../markdownExtensions';
|
import { MarkdownContributionProvider } from '../markdownExtensions';
|
||||||
import { disposeAll } from '../util/dispose';
|
import { disposeAll } from '../util/dispose';
|
||||||
import { MarkdownFileTopmostLineMonitor } from '../util/topmostLineMonitor';
|
import { MarkdownFileTopmostLineMonitor } from '../util/topmostLineMonitor';
|
||||||
import { MarkdownPreview, PreviewSettings } from './preview';
|
import { MarkdownPreview, PreviewSettings } from './preview';
|
||||||
@@ -25,7 +25,7 @@ export class MarkdownPreviewManager implements vscode.WebviewPanelSerializer {
|
|||||||
public constructor(
|
public constructor(
|
||||||
private readonly _contentProvider: MarkdownContentProvider,
|
private readonly _contentProvider: MarkdownContentProvider,
|
||||||
private readonly _logger: Logger,
|
private readonly _logger: Logger,
|
||||||
private readonly _contributions: MarkdownContributions
|
private readonly _contributions: MarkdownContributionProvider
|
||||||
) {
|
) {
|
||||||
this._disposables.push(vscode.window.registerWebviewPanelSerializer(MarkdownPreview.viewType, this));
|
this._disposables.push(vscode.window.registerWebviewPanelSerializer(MarkdownPreview.viewType, this));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
*--------------------------------------------------------------------------------------------*/
|
*--------------------------------------------------------------------------------------------*/
|
||||||
|
|
||||||
import * as vscode from 'vscode';
|
import * as vscode from 'vscode';
|
||||||
import { disposeAll } from '../util/dispose';
|
import { Disposable } from '../util/dispose';
|
||||||
import { isMarkdownFile } from '../util/file';
|
import { isMarkdownFile } from '../util/file';
|
||||||
import { Lazy, lazy } from '../util/lazy';
|
import { Lazy, lazy } from '../util/lazy';
|
||||||
import MDDocumentSymbolProvider from './documentSymbolProvider';
|
import MDDocumentSymbolProvider from './documentSymbolProvider';
|
||||||
@@ -18,25 +18,13 @@ export interface WorkspaceMarkdownDocumentProvider {
|
|||||||
readonly onDidDeleteMarkdownDocument: vscode.Event<vscode.Uri>;
|
readonly onDidDeleteMarkdownDocument: vscode.Event<vscode.Uri>;
|
||||||
}
|
}
|
||||||
|
|
||||||
class VSCodeWorkspaceMarkdownDocumentProvider implements WorkspaceMarkdownDocumentProvider {
|
class VSCodeWorkspaceMarkdownDocumentProvider extends Disposable implements WorkspaceMarkdownDocumentProvider {
|
||||||
|
|
||||||
private readonly _onDidChangeMarkdownDocumentEmitter = new vscode.EventEmitter<SkinnyTextDocument>();
|
private readonly _onDidChangeMarkdownDocumentEmitter = this._register(new vscode.EventEmitter<SkinnyTextDocument>());
|
||||||
private readonly _onDidCreateMarkdownDocumentEmitter = new vscode.EventEmitter<SkinnyTextDocument>();
|
private readonly _onDidCreateMarkdownDocumentEmitter = this._register(new vscode.EventEmitter<SkinnyTextDocument>());
|
||||||
private readonly _onDidDeleteMarkdownDocumentEmitter = new vscode.EventEmitter<vscode.Uri>();
|
private readonly _onDidDeleteMarkdownDocumentEmitter = this._register(new vscode.EventEmitter<vscode.Uri>());
|
||||||
|
|
||||||
private _watcher: vscode.FileSystemWatcher | undefined;
|
private _watcher: vscode.FileSystemWatcher | undefined;
|
||||||
private _disposables: vscode.Disposable[] = [];
|
|
||||||
|
|
||||||
public dispose() {
|
|
||||||
this._onDidChangeMarkdownDocumentEmitter.dispose();
|
|
||||||
this._onDidDeleteMarkdownDocumentEmitter.dispose();
|
|
||||||
|
|
||||||
if (this._watcher) {
|
|
||||||
this._watcher.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
disposeAll(this._disposables);
|
|
||||||
}
|
|
||||||
|
|
||||||
async getAllMarkdownDocuments() {
|
async getAllMarkdownDocuments() {
|
||||||
const resources = await vscode.workspace.findFiles('**/*.md', '**/node_modules/**');
|
const resources = await vscode.workspace.findFiles('**/*.md', '**/node_modules/**');
|
||||||
@@ -64,7 +52,7 @@ class VSCodeWorkspaceMarkdownDocumentProvider implements WorkspaceMarkdownDocume
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._watcher = vscode.workspace.createFileSystemWatcher('**/*.md');
|
this._watcher = this._register(vscode.workspace.createFileSystemWatcher('**/*.md'));
|
||||||
|
|
||||||
this._watcher.onDidChange(async resource => {
|
this._watcher.onDidChange(async resource => {
|
||||||
const document = await this.getMarkdownDocument(resource);
|
const document = await this.getMarkdownDocument(resource);
|
||||||
@@ -98,15 +86,16 @@ class VSCodeWorkspaceMarkdownDocumentProvider implements WorkspaceMarkdownDocume
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export default class MarkdownWorkspaceSymbolProvider implements vscode.WorkspaceSymbolProvider {
|
export default class MarkdownWorkspaceSymbolProvider extends Disposable implements vscode.WorkspaceSymbolProvider {
|
||||||
private _symbolCache = new Map<string, Lazy<Thenable<vscode.SymbolInformation[]>>>();
|
private _symbolCache = new Map<string, Lazy<Thenable<vscode.SymbolInformation[]>>>();
|
||||||
private _symbolCachePopulated: boolean = false;
|
private _symbolCachePopulated: boolean = false;
|
||||||
private _disposables: vscode.Disposable[] = [];
|
|
||||||
|
|
||||||
public constructor(
|
public constructor(
|
||||||
private _symbolProvider: MDDocumentSymbolProvider,
|
private _symbolProvider: MDDocumentSymbolProvider,
|
||||||
private _workspaceMarkdownDocumentProvider: WorkspaceMarkdownDocumentProvider = new VSCodeWorkspaceMarkdownDocumentProvider()
|
private _workspaceMarkdownDocumentProvider: WorkspaceMarkdownDocumentProvider = new VSCodeWorkspaceMarkdownDocumentProvider()
|
||||||
) { }
|
) {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
public async provideWorkspaceSymbols(query: string): Promise<vscode.SymbolInformation[]> {
|
public async provideWorkspaceSymbols(query: string): Promise<vscode.SymbolInformation[]> {
|
||||||
if (!this._symbolCachePopulated) {
|
if (!this._symbolCachePopulated) {
|
||||||
@@ -130,10 +119,6 @@ export default class MarkdownWorkspaceSymbolProvider implements vscode.Workspace
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public dispose(): void {
|
|
||||||
disposeAll(this._disposables);
|
|
||||||
}
|
|
||||||
|
|
||||||
private getSymbols(document: SkinnyTextDocument): Lazy<Thenable<vscode.SymbolInformation[]>> {
|
private getSymbols(document: SkinnyTextDocument): Lazy<Thenable<vscode.SymbolInformation[]>> {
|
||||||
return lazy(async () => {
|
return lazy(async () => {
|
||||||
return this._symbolProvider.provideDocumentSymbolInformation(document);
|
return this._symbolProvider.provideDocumentSymbolInformation(document);
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user