mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
Merge branch 'master' into unused-variables
This commit is contained in:
commit
00df3bdc28
2
.github/classifier.yml
vendored
2
.github/classifier.yml
vendored
|
@ -10,7 +10,7 @@
|
|||
color-picker: [],
|
||||
css-less-sass: [],
|
||||
debug: {
|
||||
assignees: [ isidorn ],
|
||||
assignees: [ weinand ],
|
||||
assignLabel: false
|
||||
},
|
||||
diff-editor: [],
|
||||
|
|
|
@ -711,29 +711,6 @@
|
|||
"END OF TERMS AND CONDITIONS"
|
||||
]
|
||||
},
|
||||
{
|
||||
"isLicense": true,
|
||||
"name": "noice-json-rpc",
|
||||
"repositoryURL": "https://github.com/nojvek/noice-json-rpc",
|
||||
"license": "MIT",
|
||||
"licenseDetail": [
|
||||
"Copyright (c) Manoj Patel",
|
||||
"",
|
||||
"MIT License",
|
||||
"",
|
||||
"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."
|
||||
]
|
||||
},
|
||||
{
|
||||
"isLicense": true,
|
||||
"name": "@types/source-map",
|
||||
|
|
|
@ -60,7 +60,8 @@ This project incorporates components from the projects listed below. The origina
|
|||
53. textmate/ruby.tmbundle (https://github.com/textmate/ruby.tmbundle)
|
||||
54. textmate/yaml.tmbundle (https://github.com/textmate/yaml.tmbundle)
|
||||
55. TypeScript-TmLanguage version 0.1.8 (https://github.com/Microsoft/TypeScript-TmLanguage)
|
||||
56. vscode-swift version 0.0.1 (https://github.com/owensd/vscode-swift)
|
||||
56. vscode-logfile-highlighter version 1.2.0 (https://github.com/emilast/vscode-logfile-highlighter)
|
||||
57. vscode-swift version 0.0.1 (https://github.com/owensd/vscode-swift)
|
||||
|
||||
|
||||
%% atom/language-c NOTICES AND INFORMATION BEGIN HERE
|
||||
|
@ -1823,6 +1824,32 @@ THE SOFTWARE.
|
|||
=========================================
|
||||
END OF TypeScript-TmLanguage NOTICES AND INFORMATION
|
||||
|
||||
%% vscode-logfile-highlighter NOTICES AND INFORMATION BEGIN HERE
|
||||
=========================================
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015 emilast
|
||||
|
||||
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 vscode-logfile-highlighter NOTICES AND INFORMATION
|
||||
|
||||
%% vscode-swift NOTICES AND INFORMATION BEGIN HERE
|
||||
=========================================
|
||||
The MIT License (MIT)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
[
|
||||
{
|
||||
"name": "ms-vscode.node-debug",
|
||||
"version": "1.20.7",
|
||||
"version": "1.20.10",
|
||||
"repo": "https://github.com/Microsoft/vscode-node-debug"
|
||||
},
|
||||
{
|
||||
|
|
20
build/builtin/.eslintrc
Normal file
20
build/builtin/.eslintrc
Normal file
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"env": {
|
||||
"node": true,
|
||||
"es6": true,
|
||||
"browser": true
|
||||
},
|
||||
"rules": {
|
||||
"no-console": 0,
|
||||
"no-cond-assign": 0,
|
||||
"no-unused-vars": 1,
|
||||
"no-extra-semi": "warn",
|
||||
"semi": "warn"
|
||||
},
|
||||
"extends": "eslint:recommended",
|
||||
"parserOptions": {
|
||||
"ecmaFeatures": {
|
||||
"experimentalObjectRestSpread": true
|
||||
}
|
||||
}
|
||||
}
|
125
build/builtin/browser-main.js
Normal file
125
build/builtin/browser-main.js
Normal file
|
@ -0,0 +1,125 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const os = require('os');
|
||||
const { remote } = require('electron');
|
||||
const dialog = remote.dialog;
|
||||
|
||||
const builtInExtensionsPath = path.join(__dirname, '..', 'builtInExtensions.json');
|
||||
const controlFilePath = path.join(os.homedir(), '.vscode-oss-dev', 'extensions', 'control.json');
|
||||
|
||||
function readJson(filePath) {
|
||||
return JSON.parse(fs.readFileSync(filePath));
|
||||
}
|
||||
|
||||
function writeJson(filePath, obj) {
|
||||
fs.writeFileSync(filePath, JSON.stringify(obj, null, 2));
|
||||
}
|
||||
|
||||
function renderOption(form, id, title, value, checked) {
|
||||
const input = document.createElement('input');
|
||||
input.type = 'radio';
|
||||
input.id = id;
|
||||
input.name = 'choice';
|
||||
input.value = value;
|
||||
input.checked = !!checked;
|
||||
form.appendChild(input);
|
||||
|
||||
const label = document.createElement('label');
|
||||
label.setAttribute('for', id);
|
||||
label.textContent = title;
|
||||
form.appendChild(label);
|
||||
|
||||
return input;
|
||||
}
|
||||
|
||||
function render(el, state) {
|
||||
function setState(state) {
|
||||
try {
|
||||
writeJson(controlFilePath, state.control);
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
|
||||
el.innerHTML = '';
|
||||
render(el, state);
|
||||
}
|
||||
|
||||
const ul = document.createElement('ul');
|
||||
const { builtin, control } = state;
|
||||
|
||||
for (const ext of builtin) {
|
||||
const controlState = control[ext.name] || 'marketplace';
|
||||
|
||||
const li = document.createElement('li');
|
||||
ul.appendChild(li);
|
||||
|
||||
const name = document.createElement('code');
|
||||
name.textContent = ext.name;
|
||||
li.appendChild(name);
|
||||
|
||||
const form = document.createElement('form');
|
||||
li.appendChild(form);
|
||||
|
||||
const marketplaceInput = renderOption(form, `marketplace-${ext.name}`, 'Marketplace', 'marketplace', controlState === 'marketplace');
|
||||
marketplaceInput.onchange = function () {
|
||||
control[ext.name] = 'marketplace';
|
||||
setState({ builtin, control });
|
||||
};
|
||||
|
||||
const disabledInput = renderOption(form, `disabled-${ext.name}`, 'Disabled', 'disabled', controlState === 'disabled');
|
||||
disabledInput.onchange = function () {
|
||||
control[ext.name] = 'disabled';
|
||||
setState({ builtin, control });
|
||||
};
|
||||
|
||||
let local = undefined;
|
||||
|
||||
if (controlState !== 'marketplace' && controlState !== 'disabled') {
|
||||
local = controlState;
|
||||
}
|
||||
|
||||
const localInput = renderOption(form, `local-${ext.name}`, 'Local', 'local', !!local);
|
||||
localInput.onchange = function () {
|
||||
const result = dialog.showOpenDialog(remote.getCurrentWindow(), {
|
||||
title: 'Choose Folder',
|
||||
properties: ['openDirectory']
|
||||
});
|
||||
|
||||
if (result && result.length >= 1) {
|
||||
control[ext.name] = result[0];
|
||||
}
|
||||
|
||||
setState({ builtin, control });
|
||||
};
|
||||
|
||||
if (local) {
|
||||
const localSpan = document.createElement('code');
|
||||
localSpan.className = 'local';
|
||||
localSpan.textContent = local;
|
||||
form.appendChild(localSpan);
|
||||
}
|
||||
}
|
||||
|
||||
el.appendChild(ul);
|
||||
}
|
||||
|
||||
function main() {
|
||||
const el = document.getElementById('extensions');
|
||||
const builtin = readJson(builtInExtensionsPath);
|
||||
let control;
|
||||
|
||||
try {
|
||||
control = readJson(controlFilePath);
|
||||
} catch (err) {
|
||||
control = {};
|
||||
}
|
||||
|
||||
render(el, { builtin, control });
|
||||
}
|
||||
|
||||
window.onload = main;
|
46
build/builtin/index.html
Normal file
46
build/builtin/index.html
Normal file
|
@ -0,0 +1,46 @@
|
|||
<!-- Copyright (C) Microsoft Corporation. All rights reserved. -->
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>Manage Built-in Extensions</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<script src="browser-main.js"></script>
|
||||
<style>
|
||||
body {
|
||||
font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
|
||||
font-size: 10pt;
|
||||
}
|
||||
|
||||
code {
|
||||
font-family: 'Menlo', 'Courier New', 'Courier', monospace;
|
||||
}
|
||||
|
||||
ul {
|
||||
padding-left: 1em;
|
||||
}
|
||||
|
||||
li {
|
||||
list-style: none;
|
||||
padding: 0.3em 0;
|
||||
}
|
||||
|
||||
label {
|
||||
margin-right: 1em;
|
||||
}
|
||||
|
||||
form {
|
||||
padding: 0.3em 0 0.3em 0.3em;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1>Built-in Extensions</h1>
|
||||
<div id="extensions"></div>
|
||||
</body>
|
||||
|
||||
</html>
|
20
build/builtin/main.js
Normal file
20
build/builtin/main.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
const { app, BrowserWindow } = require('electron');
|
||||
const url = require('url');
|
||||
const path = require('path');
|
||||
|
||||
let window = null;
|
||||
|
||||
app.once('ready', () => {
|
||||
window = new BrowserWindow({ width: 800, height: 600 });
|
||||
window.setMenuBarVisibility(false);
|
||||
window.loadURL(url.format({ pathname: path.join(__dirname, 'index.html'), protocol: 'file:', slashes: true }));
|
||||
// window.webContents.openDevTools();
|
||||
window.once('closed', () => window = null);
|
||||
});
|
||||
|
||||
app.on('window-all-closed', () => app.quit());
|
5
build/builtin/package.json
Normal file
5
build/builtin/package.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"name": "builtin",
|
||||
"version": "0.1.0",
|
||||
"main": "main.js"
|
||||
}
|
|
@ -63,10 +63,10 @@ const tasks = compilations.map(function (tsconfigFile) {
|
|||
let headerId, headerOut;
|
||||
let index = relativeDirname.indexOf('/');
|
||||
if (index < 0) {
|
||||
headerId = relativeDirname;
|
||||
headerId = 'vscode.' + relativeDirname;
|
||||
headerOut = 'out';
|
||||
} else {
|
||||
headerId = relativeDirname.substr(0, index);
|
||||
headerId = 'vscode.' + relativeDirname.substr(0, index);
|
||||
headerOut = relativeDirname.substr(index + 1) + '/out';
|
||||
}
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ const i18n = require('./lib/i18n');
|
|||
const glob = require('glob');
|
||||
const deps = require('./dependencies');
|
||||
const getElectronVersion = require('./lib/electron').getElectronVersion;
|
||||
// const createAsar = require('./lib/asar').createAsar;
|
||||
|
||||
const productionDependencies = deps.getProductionDependencies(path.dirname(__dirname));
|
||||
const baseModules = Object.keys(process.binding('natives')).filter(n => !/^_|\//.test(n));
|
||||
|
@ -92,7 +93,7 @@ const BUNDLED_FILE_HEADER = [
|
|||
' *--------------------------------------------------------*/'
|
||||
].join('\n');
|
||||
|
||||
const languages = 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-optimized-vscode', util.rimraf('out-vscode'));
|
||||
gulp.task('optimize-vscode', ['clean-optimized-vscode', 'compile-build', 'compile-extensions-build'], common.optimizeTask({
|
||||
|
@ -301,9 +302,10 @@ function packageTask(platform, arch, opts) {
|
|||
.pipe(util.cleanNodeModule('windows-process-tree', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node']))
|
||||
.pipe(util.cleanNodeModule('gc-signals', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['**/*.node', 'src/index.js']))
|
||||
.pipe(util.cleanNodeModule('keytar', ['binding.gyp', 'build/**', 'src/**', 'script/**', 'node_modules/**'], ['**/*.node']))
|
||||
.pipe(util.cleanNodeModule('node-pty', ['binding.gyp', 'build/**', 'src/**', 'tools/**'], ['build/Release/**']))
|
||||
.pipe(util.cleanNodeModule('node-pty', ['binding.gyp', 'build/**', 'src/**', 'tools/**'], ['build/Release/*.exe', 'build/Release/*.dll', 'build/Release/*.node']))
|
||||
.pipe(util.cleanNodeModule('nsfw', ['binding.gyp', 'build/**', 'src/**', 'openpa/**', 'includes/**'], ['**/*.node', '**/*.a']))
|
||||
.pipe(util.cleanNodeModule('vsda', ['binding.gyp', 'README.md', 'build/**', '*.bat', '*.sh', '*.cpp', '*.h'], ['build/Release/vsda.node']));
|
||||
// .pipe(createAsar(path.join(process.cwd(), 'node_modules'), ['**/*.node', '**/vscode-ripgrep/bin/*', '**/node-pty/build/Release/*'], 'app/node_modules.asar'));
|
||||
|
||||
let all = es.merge(
|
||||
packageJsonStream,
|
||||
|
@ -399,7 +401,7 @@ const apiHostname = process.env.TRANSIFEX_API_URL;
|
|||
const apiName = process.env.TRANSIFEX_API_NAME;
|
||||
const apiToken = process.env.TRANSIFEX_API_TOKEN;
|
||||
|
||||
gulp.task('vscode-translations-push', function () {
|
||||
gulp.task('vscode-translations-push', [ 'optimize-vscode' ], function () {
|
||||
const pathToMetadata = './out-vscode/nls.metadata.json';
|
||||
const pathToExtensions = './extensions/*';
|
||||
const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}';
|
||||
|
@ -412,7 +414,7 @@ gulp.task('vscode-translations-push', function () {
|
|||
).pipe(i18n.pushXlfFiles(apiHostname, apiName, apiToken));
|
||||
});
|
||||
|
||||
gulp.task('vscode-translations-push-test', function () {
|
||||
gulp.task('vscode-translations-push-test', [ 'optimize-vscode' ], function () {
|
||||
const pathToMetadata = './out-vscode/nls.metadata.json';
|
||||
const pathToExtensions = './extensions/*';
|
||||
const pathToSetup = 'build/win32/**/{Default.isl,messages.en.isl}';
|
||||
|
|
|
@ -217,10 +217,10 @@ function prepareSnapPackage(arch) {
|
|||
|
||||
function buildSnapPackage(arch) {
|
||||
const snapBuildPath = getSnapBuildPath(arch);
|
||||
|
||||
const snapFilename = `${product.applicationName}-${packageJson.version}-${linuxPackageRevision}-${arch}.snap`;
|
||||
return shell.task([
|
||||
`chmod +x ${snapBuildPath}/electron-launch`,
|
||||
`cd ${snapBuildPath} && snapcraft snap`
|
||||
`cd ${snapBuildPath} && snapcraft snap --output ../${snapFilename}`
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
118
build/lib/asar.js
Normal file
118
build/lib/asar.js
Normal file
|
@ -0,0 +1,118 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var path = require("path");
|
||||
var es = require("event-stream");
|
||||
var pickle = require("chromium-pickle-js");
|
||||
var Filesystem = require("asar/lib/filesystem");
|
||||
var VinylFile = require("vinyl");
|
||||
var minimatch = require("minimatch");
|
||||
function createAsar(folderPath, unpackGlobs, destFilename) {
|
||||
var shouldUnpackFile = function (file) {
|
||||
for (var i = 0; i < unpackGlobs.length; i++) {
|
||||
if (minimatch(file.relative, unpackGlobs[i])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
var filesystem = new Filesystem(folderPath);
|
||||
var out = [];
|
||||
// Keep track of pending inserts
|
||||
var pendingInserts = 0;
|
||||
var onFileInserted = function () { pendingInserts--; };
|
||||
// Do not insert twice the same directory
|
||||
var seenDir = {};
|
||||
var insertDirectoryRecursive = function (dir) {
|
||||
if (seenDir[dir]) {
|
||||
return;
|
||||
}
|
||||
var lastSlash = dir.lastIndexOf('/');
|
||||
if (lastSlash === -1) {
|
||||
lastSlash = dir.lastIndexOf('\\');
|
||||
}
|
||||
if (lastSlash !== -1) {
|
||||
insertDirectoryRecursive(dir.substring(0, lastSlash));
|
||||
}
|
||||
seenDir[dir] = true;
|
||||
filesystem.insertDirectory(dir);
|
||||
};
|
||||
var insertDirectoryForFile = function (file) {
|
||||
var lastSlash = file.lastIndexOf('/');
|
||||
if (lastSlash === -1) {
|
||||
lastSlash = file.lastIndexOf('\\');
|
||||
}
|
||||
if (lastSlash !== -1) {
|
||||
insertDirectoryRecursive(file.substring(0, lastSlash));
|
||||
}
|
||||
};
|
||||
var insertFile = function (relativePath, stat, shouldUnpack) {
|
||||
insertDirectoryForFile(relativePath);
|
||||
pendingInserts++;
|
||||
filesystem.insertFile(relativePath, shouldUnpack, { stat: stat }, {}, onFileInserted);
|
||||
};
|
||||
return es.through(function (file) {
|
||||
if (file.stat.isDirectory()) {
|
||||
return;
|
||||
}
|
||||
if (!file.stat.isFile()) {
|
||||
throw new Error("unknown item in stream!");
|
||||
}
|
||||
var shouldUnpack = shouldUnpackFile(file);
|
||||
insertFile(file.relative, { size: file.contents.length, mode: file.stat.mode }, shouldUnpack);
|
||||
if (shouldUnpack) {
|
||||
// The file goes outside of xx.asar, in a folder xx.asar.unpacked
|
||||
var relative = path.relative(folderPath, file.path);
|
||||
this.queue(new VinylFile({
|
||||
cwd: folderPath,
|
||||
base: folderPath,
|
||||
path: path.join(destFilename + '.unpacked', relative),
|
||||
stat: file.stat,
|
||||
contents: file.contents
|
||||
}));
|
||||
}
|
||||
else {
|
||||
// The file goes inside of xx.asar
|
||||
out.push(file.contents);
|
||||
}
|
||||
}, function () {
|
||||
var _this = this;
|
||||
var finish = function () {
|
||||
{
|
||||
var headerPickle = pickle.createEmpty();
|
||||
headerPickle.writeString(JSON.stringify(filesystem.header));
|
||||
var headerBuf = headerPickle.toBuffer();
|
||||
var sizePickle = pickle.createEmpty();
|
||||
sizePickle.writeUInt32(headerBuf.length);
|
||||
var sizeBuf = sizePickle.toBuffer();
|
||||
out.unshift(headerBuf);
|
||||
out.unshift(sizeBuf);
|
||||
}
|
||||
var contents = Buffer.concat(out);
|
||||
out.length = 0;
|
||||
_this.queue(new VinylFile({
|
||||
cwd: folderPath,
|
||||
base: folderPath,
|
||||
path: destFilename,
|
||||
contents: contents
|
||||
}));
|
||||
_this.queue(null);
|
||||
};
|
||||
// Call finish() only when all file inserts have finished...
|
||||
if (pendingInserts === 0) {
|
||||
finish();
|
||||
}
|
||||
else {
|
||||
onFileInserted = function () {
|
||||
pendingInserts--;
|
||||
if (pendingInserts === 0) {
|
||||
finish();
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.createAsar = createAsar;
|
131
build/lib/asar.ts
Normal file
131
build/lib/asar.ts
Normal file
|
@ -0,0 +1,131 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
|
||||
import * as path from 'path';
|
||||
import * as es from 'event-stream';
|
||||
import * as pickle from 'chromium-pickle-js';
|
||||
import * as Filesystem from 'asar/lib/filesystem';
|
||||
import * as VinylFile from 'vinyl';
|
||||
import * as minimatch from 'minimatch';
|
||||
|
||||
export function createAsar(folderPath: string, unpackGlobs: string[], destFilename: string): NodeJS.ReadWriteStream {
|
||||
|
||||
const shouldUnpackFile = (file: VinylFile): boolean => {
|
||||
for (let i = 0; i < unpackGlobs.length; i++) {
|
||||
if (minimatch(file.relative, unpackGlobs[i])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
const filesystem = new Filesystem(folderPath);
|
||||
const out: Buffer[] = [];
|
||||
|
||||
// Keep track of pending inserts
|
||||
let pendingInserts = 0;
|
||||
let onFileInserted = () => { pendingInserts--; };
|
||||
|
||||
// Do not insert twice the same directory
|
||||
const seenDir: { [key: string]: boolean; } = {};
|
||||
const insertDirectoryRecursive = (dir: string) => {
|
||||
if (seenDir[dir]) {
|
||||
return;
|
||||
}
|
||||
|
||||
let lastSlash = dir.lastIndexOf('/');
|
||||
if (lastSlash === -1) {
|
||||
lastSlash = dir.lastIndexOf('\\');
|
||||
}
|
||||
if (lastSlash !== -1) {
|
||||
insertDirectoryRecursive(dir.substring(0, lastSlash));
|
||||
}
|
||||
seenDir[dir] = true;
|
||||
filesystem.insertDirectory(dir);
|
||||
};
|
||||
|
||||
const insertDirectoryForFile = (file: string) => {
|
||||
let lastSlash = file.lastIndexOf('/');
|
||||
if (lastSlash === -1) {
|
||||
lastSlash = file.lastIndexOf('\\');
|
||||
}
|
||||
if (lastSlash !== -1) {
|
||||
insertDirectoryRecursive(file.substring(0, lastSlash));
|
||||
}
|
||||
};
|
||||
|
||||
const insertFile = (relativePath: string, stat: { size: number; mode: number; }, shouldUnpack: boolean) => {
|
||||
insertDirectoryForFile(relativePath);
|
||||
pendingInserts++;
|
||||
filesystem.insertFile(relativePath, shouldUnpack, { stat: stat }, {}, onFileInserted);
|
||||
};
|
||||
|
||||
return es.through(function (file) {
|
||||
if (file.stat.isDirectory()) {
|
||||
return;
|
||||
}
|
||||
if (!file.stat.isFile()) {
|
||||
throw new Error(`unknown item in stream!`);
|
||||
}
|
||||
const shouldUnpack = shouldUnpackFile(file);
|
||||
insertFile(file.relative, { size: file.contents.length, mode: file.stat.mode }, shouldUnpack);
|
||||
|
||||
if (shouldUnpack) {
|
||||
// The file goes outside of xx.asar, in a folder xx.asar.unpacked
|
||||
const relative = path.relative(folderPath, file.path);
|
||||
this.queue(new VinylFile({
|
||||
cwd: folderPath,
|
||||
base: folderPath,
|
||||
path: path.join(destFilename + '.unpacked', relative),
|
||||
stat: file.stat,
|
||||
contents: file.contents
|
||||
}));
|
||||
} else {
|
||||
// The file goes inside of xx.asar
|
||||
out.push(file.contents);
|
||||
}
|
||||
}, function () {
|
||||
|
||||
let finish = () => {
|
||||
{
|
||||
const headerPickle = pickle.createEmpty();
|
||||
headerPickle.writeString(JSON.stringify(filesystem.header));
|
||||
const headerBuf = headerPickle.toBuffer();
|
||||
|
||||
const sizePickle = pickle.createEmpty();
|
||||
sizePickle.writeUInt32(headerBuf.length);
|
||||
const sizeBuf = sizePickle.toBuffer();
|
||||
|
||||
out.unshift(headerBuf);
|
||||
out.unshift(sizeBuf);
|
||||
}
|
||||
|
||||
const contents = Buffer.concat(out);
|
||||
out.length = 0;
|
||||
|
||||
this.queue(new VinylFile({
|
||||
cwd: folderPath,
|
||||
base: folderPath,
|
||||
path: destFilename,
|
||||
contents: contents
|
||||
}));
|
||||
this.queue(null);
|
||||
};
|
||||
|
||||
// Call finish() only when all file inserts have finished...
|
||||
if (pendingInserts === 0) {
|
||||
finish();
|
||||
} else {
|
||||
onFileInserted = () => {
|
||||
pendingInserts--;
|
||||
if (pendingInserts === 0) {
|
||||
finish();
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const os = require('os');
|
||||
const mkdirp = require('mkdirp');
|
||||
const rimraf = require('rimraf');
|
||||
const es = require('event-stream');
|
||||
|
@ -17,7 +18,7 @@ const util = require('gulp-util');
|
|||
|
||||
const root = path.dirname(path.dirname(__dirname));
|
||||
const builtInExtensions = require('../builtInExtensions');
|
||||
const controlFilePath = path.join(process.env['HOME'], '.vscode-oss-dev', 'extensions', 'control.json');
|
||||
const controlFilePath = path.join(os.homedir(), '.vscode-oss-dev', 'extensions', 'control.json');
|
||||
|
||||
function getExtensionPath(extension) {
|
||||
return path.join(root, '.build', 'builtInExtensions', extension.name);
|
||||
|
@ -58,7 +59,6 @@ function syncExtension(extension, controlState) {
|
|||
switch (controlState) {
|
||||
case 'disabled':
|
||||
util.log(util.colors.blue('[disabled]'), util.colors.gray(extension.name));
|
||||
rimraf.sync(getExtensionPath(extension));
|
||||
return es.readArray([]);
|
||||
|
||||
case 'marketplace':
|
||||
|
@ -74,7 +74,7 @@ function syncExtension(extension, controlState) {
|
|||
return es.readArray([]);
|
||||
}
|
||||
|
||||
util.log(util.colors.blue('[local]'), `${extension.name}: ${controlState}`, util.colors.green('✔︎'));
|
||||
util.log(util.colors.blue('[local]'), `${extension.name}: ${util.colors.cyan(controlState)}`, util.colors.green('✔︎'));
|
||||
return es.readArray([]);
|
||||
}
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ function writeControlFile(control) {
|
|||
|
||||
function main() {
|
||||
util.log('Syncronizing built-in extensions...');
|
||||
util.log('Control file:', controlFilePath);
|
||||
util.log(`You can manage built-in extensions with the ${util.colors.cyan('--builtin')} flag`);
|
||||
|
||||
const control = readControlFile();
|
||||
const streams = [];
|
||||
|
@ -114,7 +114,6 @@ function main() {
|
|||
process.exit(1);
|
||||
})
|
||||
.on('end', () => {
|
||||
util.log(`${streams.length} built-in extensions processed.`);
|
||||
process.exit(0);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -40,15 +40,12 @@ exports.extraLanguages = [
|
|||
{ id: 'hu', folderName: 'hun' },
|
||||
{ id: 'tr', folderName: 'trk' }
|
||||
];
|
||||
exports.pseudoLanguage = { id: 'pseudo', folderName: 'pseudo', transifexId: 'pseudo' };
|
||||
// non built-in extensions also that are transifex and need to be part of the language packs
|
||||
var externalExtensionsWithTranslations = [
|
||||
//"azure-account",
|
||||
"vscode-chrome-debug",
|
||||
"vscode-chrome-debug-core",
|
||||
"vscode-node-debug",
|
||||
"vscode-node-debug2"
|
||||
];
|
||||
var externalExtensionsWithTranslations = {
|
||||
'vscode-chrome-debug': 'msjsdiag.debugger-for-chrome',
|
||||
'vscode-node-debug': 'ms-vscode.node-debug',
|
||||
'vscode-node-debug2': 'ms-vscode.node-debug2'
|
||||
};
|
||||
var LocalizeInfo;
|
||||
(function (LocalizeInfo) {
|
||||
function is(value) {
|
||||
|
@ -145,6 +142,10 @@ var XLF = /** @class */ (function () {
|
|||
return this.buffer.join('\r\n');
|
||||
};
|
||||
XLF.prototype.addFile = function (original, keys, messages) {
|
||||
if (keys.length === 0) {
|
||||
console.log('No keys in ' + original);
|
||||
return;
|
||||
}
|
||||
if (keys.length !== messages.length) {
|
||||
throw new Error("Unmatching keys(" + keys.length + ") and messages(" + messages.length + ").");
|
||||
}
|
||||
|
@ -196,6 +197,31 @@ var XLF = /** @class */ (function () {
|
|||
line.append(content);
|
||||
this.buffer.push(line.toString());
|
||||
};
|
||||
XLF.parsePseudo = function (xlfString) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
var parser = new xml2js.Parser();
|
||||
var files = [];
|
||||
parser.parseString(xlfString, function (err, result) {
|
||||
var fileNodes = result['xliff']['file'];
|
||||
fileNodes.forEach(function (file) {
|
||||
var originalFilePath = file.$.original;
|
||||
var messages = {};
|
||||
var transUnits = file.body[0]['trans-unit'];
|
||||
if (transUnits) {
|
||||
transUnits.forEach(function (unit) {
|
||||
var key = unit.$.id;
|
||||
var val = pseudify(unit.source[0]['_'].toString());
|
||||
if (key && val) {
|
||||
messages[key] = decodeEntities(val);
|
||||
}
|
||||
});
|
||||
files.push({ messages: messages, originalFilePath: originalFilePath, language: 'ps' });
|
||||
}
|
||||
});
|
||||
resolve(files);
|
||||
});
|
||||
});
|
||||
};
|
||||
XLF.parse = function (xlfString) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
var parser = new xml2js.Parser();
|
||||
|
@ -219,20 +245,22 @@ var XLF = /** @class */ (function () {
|
|||
}
|
||||
var messages = {};
|
||||
var transUnits = file.body[0]['trans-unit'];
|
||||
transUnits.forEach(function (unit) {
|
||||
var key = unit.$.id;
|
||||
if (!unit.target) {
|
||||
return; // No translation available
|
||||
}
|
||||
var val = unit.target.toString();
|
||||
if (key && val) {
|
||||
messages[key] = decodeEntities(val);
|
||||
}
|
||||
else {
|
||||
reject(new Error("XLF parsing error: XLIFF file does not contain full localization data. ID or target translation for one of the trans-unit nodes is not present."));
|
||||
}
|
||||
});
|
||||
files.push({ messages: messages, originalFilePath: originalFilePath, language: language.toLowerCase() });
|
||||
if (transUnits) {
|
||||
transUnits.forEach(function (unit) {
|
||||
var key = unit.$.id;
|
||||
if (!unit.target) {
|
||||
return; // No translation available
|
||||
}
|
||||
var val = unit.target.toString();
|
||||
if (key && val) {
|
||||
messages[key] = decodeEntities(val);
|
||||
}
|
||||
else {
|
||||
reject(new Error("XLF parsing error: XLIFF file does not contain full localization data. ID or target translation for one of the trans-unit nodes is not present."));
|
||||
}
|
||||
});
|
||||
files.push({ messages: messages, originalFilePath: originalFilePath, language: language.toLowerCase() });
|
||||
}
|
||||
});
|
||||
resolve(files);
|
||||
});
|
||||
|
@ -894,7 +922,7 @@ function updateResource(project, slug, xlfFile, apiHostname, credentials) {
|
|||
}
|
||||
// cache resources
|
||||
var _coreAndExtensionResources;
|
||||
function pullCoreAndExtensionsXlfFiles(apiHostname, username, password, language, includeExternalExtensions) {
|
||||
function pullCoreAndExtensionsXlfFiles(apiHostname, username, password, language, externalExtensions) {
|
||||
if (!_coreAndExtensionResources) {
|
||||
_coreAndExtensionResources = [];
|
||||
// editor and workbench
|
||||
|
@ -905,15 +933,14 @@ function pullCoreAndExtensionsXlfFiles(apiHostname, username, password, language
|
|||
var extensionsToLocalize_1 = Object.create(null);
|
||||
glob.sync('./extensions/**/*.nls.json').forEach(function (extension) { return extensionsToLocalize_1[extension.split('/')[2]] = true; });
|
||||
glob.sync('./extensions/*/node_modules/vscode-nls').forEach(function (extension) { return extensionsToLocalize_1[extension.split('/')[2]] = true; });
|
||||
if (includeExternalExtensions) {
|
||||
for (var _i = 0, externalExtensionsWithTranslations_1 = externalExtensionsWithTranslations; _i < externalExtensionsWithTranslations_1.length; _i++) {
|
||||
var extension = externalExtensionsWithTranslations_1[_i];
|
||||
extensionsToLocalize_1[extension] = true;
|
||||
}
|
||||
}
|
||||
Object.keys(extensionsToLocalize_1).forEach(function (extension) {
|
||||
_coreAndExtensionResources.push({ name: extension, project: extensionsProject });
|
||||
});
|
||||
if (externalExtensions) {
|
||||
for (var resourceName in externalExtensions) {
|
||||
_coreAndExtensionResources.push({ name: resourceName, project: extensionsProject });
|
||||
}
|
||||
}
|
||||
}
|
||||
return pullXlfFiles(apiHostname, username, password, language, _coreAndExtensionResources);
|
||||
}
|
||||
|
@ -955,7 +982,7 @@ function retrieveResource(language, resource, apiHostname, credentials) {
|
|||
return limiter.queue(function () { return new Promise(function (resolve, reject) {
|
||||
var slug = resource.name.replace(/\//g, '_');
|
||||
var project = resource.project;
|
||||
var transifexLanguageId = language.transifexId || language.id;
|
||||
var transifexLanguageId = language.id === 'ps' ? 'en' : language.transifexId || language.id;
|
||||
var options = {
|
||||
hostname: apiHostname,
|
||||
path: "/api/2/project/" + project + "/resource/" + slug + "/translation/" + transifexLanguageId + "?file&mode=onlyreviewed",
|
||||
|
@ -963,7 +990,7 @@ function retrieveResource(language, resource, apiHostname, credentials) {
|
|||
port: 443,
|
||||
method: 'GET'
|
||||
};
|
||||
console.log('Fetching ' + options.path);
|
||||
console.log('[transifex] Fetching ' + options.path);
|
||||
var request = https.request(options, function (res) {
|
||||
var xlfBuffer = [];
|
||||
res.on('data', function (chunk) { return xlfBuffer.push(chunk); });
|
||||
|
@ -972,7 +999,7 @@ function retrieveResource(language, resource, apiHostname, credentials) {
|
|||
resolve(new File({ contents: Buffer.concat(xlfBuffer), path: project + "/" + slug + ".xlf" }));
|
||||
}
|
||||
else if (res.statusCode === 404) {
|
||||
console.log(slug + " in " + project + " returned no data.");
|
||||
console.log("[transifex] " + slug + " in " + project + " returned no data.");
|
||||
resolve(null);
|
||||
}
|
||||
else {
|
||||
|
@ -1026,11 +1053,13 @@ function createI18nFile(originalFilePath, messages) {
|
|||
});
|
||||
}
|
||||
var i18nPackVersion = "1.0.0";
|
||||
function pullI18nPackFiles(apiHostname, username, password, language) {
|
||||
return pullCoreAndExtensionsXlfFiles(apiHostname, username, password, language, true).pipe(prepareI18nPackFiles());
|
||||
function pullI18nPackFiles(apiHostname, username, password, language, resultingTranslationPaths) {
|
||||
return pullCoreAndExtensionsXlfFiles(apiHostname, username, password, language, externalExtensionsWithTranslations)
|
||||
.pipe(prepareI18nPackFiles(externalExtensionsWithTranslations, resultingTranslationPaths, language.id === 'ps'));
|
||||
}
|
||||
exports.pullI18nPackFiles = pullI18nPackFiles;
|
||||
function prepareI18nPackFiles() {
|
||||
function prepareI18nPackFiles(externalExtensions, resultingTranslationPaths, pseudo) {
|
||||
if (pseudo === void 0) { pseudo = false; }
|
||||
var parsePromises = [];
|
||||
var mainPack = { version: i18nPackVersion, contents: {} };
|
||||
var extensionsPacks = {};
|
||||
|
@ -1038,8 +1067,8 @@ function prepareI18nPackFiles() {
|
|||
var stream = this;
|
||||
var project = path.dirname(xlf.path);
|
||||
var resource = path.basename(xlf.path, '.xlf');
|
||||
console.log(resource);
|
||||
var parsePromise = XLF.parse(xlf.contents.toString());
|
||||
var contents = xlf.contents.toString();
|
||||
var parsePromise = pseudo ? XLF.parsePseudo(contents) : XLF.parse(contents);
|
||||
parsePromises.push(parsePromise);
|
||||
parsePromise.then(function (resolvedFiles) {
|
||||
resolvedFiles.forEach(function (file) {
|
||||
|
@ -1050,9 +1079,14 @@ function prepareI18nPackFiles() {
|
|||
if (!extPack) {
|
||||
extPack = extensionsPacks[resource] = { version: i18nPackVersion, contents: {} };
|
||||
}
|
||||
var secondSlash = path.indexOf('/', firstSlash + 1);
|
||||
var key = externalExtensionsWithTranslations.indexOf(resource) !== -1 ? path : path.substr(secondSlash + 1);
|
||||
extPack.contents[key] = file.messages;
|
||||
var externalId = externalExtensions[resource];
|
||||
if (!externalId) {
|
||||
var secondSlash = path.indexOf('/', firstSlash + 1);
|
||||
extPack.contents[path.substr(secondSlash + 1)] = file.messages;
|
||||
}
|
||||
else {
|
||||
extPack.contents[path] = file.messages;
|
||||
}
|
||||
}
|
||||
else {
|
||||
mainPack.contents[path.substr(firstSlash + 1)] = file.messages;
|
||||
|
@ -1064,10 +1098,18 @@ function prepareI18nPackFiles() {
|
|||
Promise.all(parsePromises)
|
||||
.then(function () {
|
||||
var translatedMainFile = createI18nFile('./main', mainPack);
|
||||
resultingTranslationPaths.push({ id: 'vscode', resourceName: 'main.i18n.json' });
|
||||
_this.queue(translatedMainFile);
|
||||
for (var extension in extensionsPacks) {
|
||||
var translatedExtFile = createI18nFile("./extensions/" + extension, extensionsPacks[extension]);
|
||||
_this.queue(translatedExtFile);
|
||||
var externalExtensionId = externalExtensions[extension];
|
||||
if (externalExtensionId) {
|
||||
resultingTranslationPaths.push({ id: externalExtensionId, resourceName: "extensions/" + extension + ".i18n.json" });
|
||||
}
|
||||
else {
|
||||
resultingTranslationPaths.push({ id: "vscode." + extension, resourceName: "extensions/" + extension + ".i18n.json" });
|
||||
}
|
||||
}
|
||||
_this.queue(null);
|
||||
})
|
||||
|
@ -1173,3 +1215,6 @@ function encodeEntities(value) {
|
|||
function decodeEntities(value) {
|
||||
return value.replace(/</g, '<').replace(/>/g, '>').replace(/&/g, '&');
|
||||
}
|
||||
function pseudify(message) {
|
||||
return '\uFF3B' + message.replace(/[aouei]/g, '$&$&') + '\uFF3D';
|
||||
}
|
||||
|
|
|
@ -56,16 +56,13 @@ export const extraLanguages: Language[] = [
|
|||
{ id: 'tr', folderName: 'trk' }
|
||||
];
|
||||
|
||||
export const pseudoLanguage: Language = { id: 'pseudo', folderName: 'pseudo', transifexId: 'pseudo' };
|
||||
|
||||
// non built-in extensions also that are transifex and need to be part of the language packs
|
||||
const externalExtensionsWithTranslations = [
|
||||
//"azure-account",
|
||||
"vscode-chrome-debug",
|
||||
"vscode-chrome-debug-core",
|
||||
"vscode-node-debug",
|
||||
"vscode-node-debug2"
|
||||
];
|
||||
const externalExtensionsWithTranslations = {
|
||||
'vscode-chrome-debug': 'msjsdiag.debugger-for-chrome',
|
||||
'vscode-node-debug': 'ms-vscode.node-debug',
|
||||
'vscode-node-debug2': 'ms-vscode.node-debug2'
|
||||
};
|
||||
|
||||
|
||||
interface Map<V> {
|
||||
[key: string]: V;
|
||||
|
@ -226,6 +223,10 @@ export class XLF {
|
|||
}
|
||||
|
||||
public addFile(original: string, keys: (string | LocalizeInfo)[], messages: string[]) {
|
||||
if (keys.length === 0) {
|
||||
console.log('No keys in ' + original);
|
||||
return;
|
||||
}
|
||||
if (keys.length !== messages.length) {
|
||||
throw new Error(`Unmatching keys(${keys.length}) and messages(${messages.length}).`);
|
||||
}
|
||||
|
@ -284,6 +285,32 @@ export class XLF {
|
|||
this.buffer.push(line.toString());
|
||||
}
|
||||
|
||||
static parsePseudo = function (xlfString: string): Promise<ParsedXLF[]> {
|
||||
return new Promise((resolve, reject) => {
|
||||
let parser = new xml2js.Parser();
|
||||
let files: { messages: Map<string>, originalFilePath: string, language: string }[] = [];
|
||||
parser.parseString(xlfString, function (err, result) {
|
||||
const fileNodes: any[] = result['xliff']['file'];
|
||||
fileNodes.forEach(file => {
|
||||
const originalFilePath = file.$.original;
|
||||
const messages: Map<string> = {};
|
||||
const transUnits = file.body[0]['trans-unit'];
|
||||
if (transUnits) {
|
||||
transUnits.forEach(unit => {
|
||||
const key = unit.$.id;
|
||||
const val = pseudify(unit.source[0]['_'].toString());
|
||||
if (key && val) {
|
||||
messages[key] = decodeEntities(val);
|
||||
}
|
||||
});
|
||||
files.push({ messages: messages, originalFilePath: originalFilePath, language: 'ps' });
|
||||
}
|
||||
});
|
||||
resolve(files);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
static parse = function (xlfString: string): Promise<ParsedXLF[]> {
|
||||
return new Promise((resolve, reject) => {
|
||||
let parser = new xml2js.Parser();
|
||||
|
@ -305,29 +332,29 @@ export class XLF {
|
|||
if (!originalFilePath) {
|
||||
reject(new Error(`XLF parsing error: XLIFF file node does not contain original attribute to determine the original location of the resource file.`));
|
||||
}
|
||||
const language = file.$['target-language'];
|
||||
let language = file.$['target-language'];
|
||||
if (!language) {
|
||||
reject(new Error(`XLF parsing error: XLIFF file node does not contain target-language attribute to determine translated language.`));
|
||||
}
|
||||
const messages: Map<string> = {};
|
||||
|
||||
let messages: Map<string> = {};
|
||||
const transUnits = file.body[0]['trans-unit'];
|
||||
if (transUnits) {
|
||||
transUnits.forEach(unit => {
|
||||
const key = unit.$.id;
|
||||
if (!unit.target) {
|
||||
return; // No translation available
|
||||
}
|
||||
|
||||
transUnits.forEach(unit => {
|
||||
const key = unit.$.id;
|
||||
if (!unit.target) {
|
||||
return; // No translation available
|
||||
}
|
||||
|
||||
const val = unit.target.toString();
|
||||
if (key && val) {
|
||||
messages[key] = decodeEntities(val);
|
||||
} else {
|
||||
reject(new Error(`XLF parsing error: XLIFF file does not contain full localization data. ID or target translation for one of the trans-unit nodes is not present.`));
|
||||
}
|
||||
});
|
||||
|
||||
files.push({ messages: messages, originalFilePath: originalFilePath, language: language.toLowerCase() });
|
||||
const val = unit.target.toString();
|
||||
if (key && val) {
|
||||
messages[key] = decodeEntities(val);
|
||||
} else {
|
||||
reject(new Error(`XLF parsing error: XLIFF file does not contain full localization data. ID or target translation for one of the trans-unit nodes is not present.`));
|
||||
}
|
||||
});
|
||||
files.push({ messages: messages, originalFilePath: originalFilePath, language: language.toLowerCase() });
|
||||
}
|
||||
});
|
||||
|
||||
resolve(files);
|
||||
|
@ -1011,7 +1038,7 @@ function updateResource(project: string, slug: string, xlfFile: File, apiHostnam
|
|||
// cache resources
|
||||
let _coreAndExtensionResources: Resource[];
|
||||
|
||||
export function pullCoreAndExtensionsXlfFiles(apiHostname: string, username: string, password: string, language: Language, includeExternalExtensions?: boolean): NodeJS.ReadableStream {
|
||||
export function pullCoreAndExtensionsXlfFiles(apiHostname: string, username: string, password: string, language: Language, externalExtensions?: Map<string>): NodeJS.ReadableStream {
|
||||
if (!_coreAndExtensionResources) {
|
||||
_coreAndExtensionResources = [];
|
||||
// editor and workbench
|
||||
|
@ -1024,15 +1051,15 @@ export function pullCoreAndExtensionsXlfFiles(apiHostname: string, username: str
|
|||
glob.sync('./extensions/**/*.nls.json', ).forEach(extension => extensionsToLocalize[extension.split('/')[2]] = true);
|
||||
glob.sync('./extensions/*/node_modules/vscode-nls', ).forEach(extension => extensionsToLocalize[extension.split('/')[2]] = true);
|
||||
|
||||
if (includeExternalExtensions) {
|
||||
for (let extension of externalExtensionsWithTranslations) {
|
||||
extensionsToLocalize[extension] = true;
|
||||
}
|
||||
}
|
||||
|
||||
Object.keys(extensionsToLocalize).forEach(extension => {
|
||||
_coreAndExtensionResources.push({ name: extension, project: extensionsProject });
|
||||
});
|
||||
|
||||
if (externalExtensions) {
|
||||
for (let resourceName in externalExtensions) {
|
||||
_coreAndExtensionResources.push({ name: resourceName, project: extensionsProject });
|
||||
}
|
||||
}
|
||||
}
|
||||
return pullXlfFiles(apiHostname, username, password, language, _coreAndExtensionResources);
|
||||
}
|
||||
|
@ -1078,7 +1105,7 @@ function retrieveResource(language: Language, resource: Resource, apiHostname, c
|
|||
return limiter.queue(() => new Promise<File>((resolve, reject) => {
|
||||
const slug = resource.name.replace(/\//g, '_');
|
||||
const project = resource.project;
|
||||
const transifexLanguageId = language.transifexId || language.id;
|
||||
let transifexLanguageId = language.id === 'ps' ? 'en' : language.transifexId || language.id;
|
||||
const options = {
|
||||
hostname: apiHostname,
|
||||
path: `/api/2/project/${project}/resource/${slug}/translation/${transifexLanguageId}?file&mode=onlyreviewed`,
|
||||
|
@ -1086,7 +1113,7 @@ function retrieveResource(language: Language, resource: Resource, apiHostname, c
|
|||
port: 443,
|
||||
method: 'GET'
|
||||
};
|
||||
console.log('Fetching ' + options.path);
|
||||
console.log('[transifex] Fetching ' + options.path);
|
||||
|
||||
let request = https.request(options, (res) => {
|
||||
let xlfBuffer: Buffer[] = [];
|
||||
|
@ -1095,7 +1122,7 @@ function retrieveResource(language: Language, resource: Resource, apiHostname, c
|
|||
if (res.statusCode === 200) {
|
||||
resolve(new File({ contents: Buffer.concat(xlfBuffer), path: `${project}/${slug}.xlf` }));
|
||||
} else if (res.statusCode === 404) {
|
||||
console.log(`${slug} in ${project} returned no data.`);
|
||||
console.log(`[transifex] ${slug} in ${project} returned no data.`);
|
||||
resolve(null);
|
||||
} else {
|
||||
reject(`${slug} in ${project} returned no data. Response code: ${res.statusCode}.`);
|
||||
|
@ -1160,11 +1187,17 @@ interface I18nPack {
|
|||
|
||||
const i18nPackVersion = "1.0.0";
|
||||
|
||||
export function pullI18nPackFiles(apiHostname: string, username: string, password: string, language: Language): NodeJS.ReadableStream {
|
||||
return pullCoreAndExtensionsXlfFiles(apiHostname, username, password, language, true).pipe(prepareI18nPackFiles());
|
||||
export interface TranslationPath {
|
||||
id: string;
|
||||
resourceName: string;
|
||||
}
|
||||
|
||||
export function prepareI18nPackFiles() {
|
||||
export function pullI18nPackFiles(apiHostname: string, username: string, password: string, language: Language, resultingTranslationPaths: TranslationPath[]): NodeJS.ReadableStream {
|
||||
return pullCoreAndExtensionsXlfFiles(apiHostname, username, password, language, externalExtensionsWithTranslations)
|
||||
.pipe(prepareI18nPackFiles(externalExtensionsWithTranslations, resultingTranslationPaths, language.id === 'ps'));
|
||||
}
|
||||
|
||||
export function prepareI18nPackFiles(externalExtensions: Map<string>, resultingTranslationPaths: TranslationPath[], pseudo = false): NodeJS.ReadWriteStream {
|
||||
let parsePromises: Promise<ParsedXLF[]>[] = [];
|
||||
let mainPack: I18nPack = { version: i18nPackVersion, contents: {} };
|
||||
let extensionsPacks: Map<I18nPack> = {};
|
||||
|
@ -1172,8 +1205,8 @@ export function prepareI18nPackFiles() {
|
|||
let stream = this;
|
||||
let project = path.dirname(xlf.path);
|
||||
let resource = path.basename(xlf.path, '.xlf');
|
||||
console.log(resource);
|
||||
let parsePromise = XLF.parse(xlf.contents.toString());
|
||||
let contents = xlf.contents.toString();
|
||||
let parsePromise = pseudo ? XLF.parsePseudo(contents) : XLF.parse(contents);
|
||||
parsePromises.push(parsePromise);
|
||||
parsePromise.then(
|
||||
resolvedFiles => {
|
||||
|
@ -1186,9 +1219,13 @@ export function prepareI18nPackFiles() {
|
|||
if (!extPack) {
|
||||
extPack = extensionsPacks[resource] = { version: i18nPackVersion, contents: {} };
|
||||
}
|
||||
const secondSlash = path.indexOf('/', firstSlash + 1);
|
||||
let key = externalExtensionsWithTranslations.indexOf(resource) !== -1 ? path: path.substr(secondSlash + 1);
|
||||
extPack.contents[key] = file.messages;
|
||||
const externalId = externalExtensions[resource];
|
||||
if (!externalId) { // internal extension: remove 'extensions/extensionId/' segnent
|
||||
const secondSlash = path.indexOf('/', firstSlash + 1);
|
||||
extPack.contents[path.substr(secondSlash + 1)] = file.messages;
|
||||
} else {
|
||||
extPack.contents[path] = file.messages;
|
||||
}
|
||||
} else {
|
||||
mainPack.contents[path.substr(firstSlash + 1)] = file.messages;
|
||||
}
|
||||
|
@ -1199,10 +1236,20 @@ export function prepareI18nPackFiles() {
|
|||
Promise.all(parsePromises)
|
||||
.then(() => {
|
||||
const translatedMainFile = createI18nFile('./main', mainPack);
|
||||
resultingTranslationPaths.push({ id: 'vscode', resourceName: 'main.i18n.json' });
|
||||
|
||||
this.queue(translatedMainFile);
|
||||
for (let extension in extensionsPacks) {
|
||||
const translatedExtFile = createI18nFile(`./extensions/${extension}`, extensionsPacks[extension]);
|
||||
this.queue(translatedExtFile);
|
||||
|
||||
const externalExtensionId = externalExtensions[extension];
|
||||
if (externalExtensionId) {
|
||||
resultingTranslationPaths.push({ id: externalExtensionId, resourceName: `extensions/${extension}.i18n.json` });
|
||||
} else {
|
||||
resultingTranslationPaths.push({ id: `vscode.${extension}`, resourceName: `extensions/${extension}.i18n.json` });
|
||||
}
|
||||
|
||||
}
|
||||
this.queue(null);
|
||||
})
|
||||
|
@ -1308,4 +1355,8 @@ function encodeEntities(value: string): string {
|
|||
|
||||
function decodeEntities(value: string): string {
|
||||
return value.replace(/</g, '<').replace(/>/g, '>').replace(/&/g, '&');
|
||||
}
|
||||
|
||||
function pseudify(message: string) {
|
||||
return '\uFF3B' + message.replace(/[aouei]/g, '$&$&') + '\uFF3D';
|
||||
}
|
|
@ -36,14 +36,14 @@ function update(idOrPath) {
|
|||
}
|
||||
|
||||
localizations.forEach(function (localization) {
|
||||
if (!localization.languageId || !localization.languageName || !localization.translations) {
|
||||
throw new Error('Each localization contribution must define "languageId", "languageName" and "translations" properties.');
|
||||
if (!localization.languageId || !localization.languageName || !localization.localizedLanguageName) {
|
||||
throw new Error('Each localization contribution must define "languageId", "languageName" and "localizedLanguageName" properties.');
|
||||
}
|
||||
let server = localization.server || 'www.transifex.com';
|
||||
let userName = localization.userName || 'api';
|
||||
let apiToken = process.env.TRANSIFEX_API_TOKEN;
|
||||
let languageId = localization.transifexId || localization.languageId;
|
||||
let translationDataFolder = path.join(locExtFolder, localization.translations);
|
||||
let translationDataFolder = path.join(locExtFolder, 'translations');
|
||||
|
||||
if (fs.existsSync(translationDataFolder) && fs.existsSync(path.join(translationDataFolder, 'main.i18n.json'))) {
|
||||
console.log('Clearing \'' + translationDataFolder + '\'...');
|
||||
|
@ -51,8 +51,16 @@ function update(idOrPath) {
|
|||
}
|
||||
|
||||
console.log('Downloading translations for \'' + languageId + '\' to \'' + translationDataFolder + '\'...');
|
||||
i18n.pullI18nPackFiles(server, userName, apiToken, { id: languageId })
|
||||
.pipe(vfs.dest(translationDataFolder));
|
||||
const translationPaths = [];
|
||||
i18n.pullI18nPackFiles(server, userName, apiToken, { id: languageId }, translationPaths)
|
||||
.pipe(vfs.dest(translationDataFolder)).on('end', function () {
|
||||
localization.translations = [];
|
||||
for (let tp of translationPaths) {
|
||||
localization.translations.push({ id: tp.id, path: `./translations/${tp.resourceName}`});
|
||||
}
|
||||
fs.writeFileSync(path.join(locExtFolder, 'package.json'), JSON.stringify(packageJSON, null, '\t'));
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -51,6 +51,8 @@ Type: filesandordirs; Name: "{app}\resources\app\out"; Check: IsNotUpdate
|
|||
Type: filesandordirs; Name: "{app}\resources\app\plugins"; Check: IsNotUpdate
|
||||
Type: filesandordirs; Name: "{app}\resources\app\extensions"; Check: IsNotUpdate
|
||||
Type: filesandordirs; Name: "{app}\resources\app\node_modules"; Check: IsNotUpdate
|
||||
Type: filesandordirs; Name: "{app}\resources\app\node_modules.asar.unpacked"; Check: IsNotUpdate
|
||||
Type: files; Name: "{app}\resources\app\node_modules.asar"; Check: IsNotUpdate
|
||||
Type: files; Name: "{app}\resources\app\Credits_45.0.2454.85.html"; Check: IsNotUpdate
|
||||
|
||||
[UninstallDelete]
|
||||
|
@ -1003,7 +1005,7 @@ begin
|
|||
Result := ExpandConstant('{app}');
|
||||
end;
|
||||
|
||||
function BoolToStr(Value: Boolean): String;
|
||||
function BoolToStr(Value: Boolean): String;
|
||||
begin
|
||||
if Value then
|
||||
Result := 'true'
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"jsonc-parser": "^1.0.0",
|
||||
"vscode-nls": "^3.1.2"
|
||||
"vscode-nls": "^3.2.1"
|
||||
},
|
||||
"contributes": {
|
||||
"jsonValidation": [
|
||||
|
|
|
@ -10,6 +10,6 @@ jsonc-parser@^1.0.0:
|
|||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-1.0.0.tgz#ddcc864ae708e60a7a6dd36daea00172fa8d9272"
|
||||
|
||||
vscode-nls@^3.1.2:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.1.2.tgz#c1b63f4338ac49c852267633dd99717916424a74"
|
||||
vscode-nls@^3.2.1:
|
||||
version "3.2.1"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.2.1.tgz#b1f3e04e8a94a715d5a7bcbc8339c51e6d74ca51"
|
||||
|
|
|
@ -714,7 +714,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"vscode-languageclient": "^3.5.0",
|
||||
"vscode-nls": "^3.1.2"
|
||||
"vscode-nls": "^3.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "7.0.43"
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
"node": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"vscode-css-languageservice": "^3.0.3",
|
||||
"vscode-css-languageservice": "^3.0.5",
|
||||
"vscode-languageserver": "^3.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
version "7.0.43"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.43.tgz#a187e08495a075f200ca946079c914e1a5fe962c"
|
||||
|
||||
vscode-css-languageservice@^3.0.3:
|
||||
version "3.0.3"
|
||||
resolved "https://registry.yarnpkg.com/vscode-css-languageservice/-/vscode-css-languageservice-3.0.3.tgz#02cc4efa5335f5104e0a2f3b6920faaf59db4f7a"
|
||||
vscode-css-languageservice@^3.0.5:
|
||||
version "3.0.5"
|
||||
resolved "https://registry.yarnpkg.com/vscode-css-languageservice/-/vscode-css-languageservice-3.0.5.tgz#8470989c07bbe740db4fa621423e98384d2c342f"
|
||||
dependencies:
|
||||
vscode-languageserver-types "3.5.0"
|
||||
vscode-nls "^2.0.1"
|
||||
|
|
|
@ -27,6 +27,6 @@ vscode-languageserver-types@^3.5.0:
|
|||
version "3.5.0"
|
||||
resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.5.0.tgz#e48d79962f0b8e02de955e3f524908e2b19c0374"
|
||||
|
||||
vscode-nls@^3.1.2:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.1.2.tgz#c1b63f4338ac49c852267633dd99717916424a74"
|
||||
vscode-nls@^3.2.1:
|
||||
version "3.2.1"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.2.1.tgz#b1f3e04e8a94a715d5a7bcbc8339c51e6d74ca51"
|
||||
|
|
|
@ -178,6 +178,26 @@
|
|||
"type": "boolean",
|
||||
"default": false,
|
||||
"description": "%emmetPreferencesAllowCompactBoolean%"
|
||||
},
|
||||
"css.webkitProperties": {
|
||||
"type": "string",
|
||||
"default": null,
|
||||
"description": "%emmetPreferencesCssWebkitProperties%"
|
||||
},
|
||||
"css.mozProperties": {
|
||||
"type": "string",
|
||||
"default": null,
|
||||
"description": "%emmetPreferencesCssMozProperties%"
|
||||
},
|
||||
"css.oProperties": {
|
||||
"type": "string",
|
||||
"default": null,
|
||||
"description": "%emmetPreferencesCssOProperties%"
|
||||
},
|
||||
"css.msProperties": {
|
||||
"type": "string",
|
||||
"default": null,
|
||||
"description": "%emmetPreferencesCssMsProperties%"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -317,9 +337,9 @@
|
|||
"@emmetio/html-matcher": "^0.3.3",
|
||||
"@emmetio/css-parser": "ramya-rao-a/css-parser#vscode",
|
||||
"@emmetio/math-expression": "^0.1.1",
|
||||
"vscode-emmet-helper": "^1.1.22",
|
||||
"vscode-emmet-helper": "^1.1.24",
|
||||
"vscode-languageserver-types": "^3.5.0",
|
||||
"image-size": "^0.5.2",
|
||||
"vscode-nls": "3.1.2"
|
||||
"vscode-nls": "3.2.1"
|
||||
}
|
||||
}
|
|
@ -47,5 +47,9 @@
|
|||
"emmetPreferencesFilterCommentTrigger": "A comma-separated list of attribute names that should exist in abbreviation for the comment filter to be applied",
|
||||
"emmetPreferencesFormatNoIndentTags": "An array of tag names that should not get inner indentation",
|
||||
"emmetPreferencesFormatForceIndentTags": "An array of tag names that should always get inner indentation",
|
||||
"emmetPreferencesAllowCompactBoolean": "If true, compact notation of boolean attributes are produced"
|
||||
"emmetPreferencesAllowCompactBoolean": "If true, compact notation of boolean attributes are produced",
|
||||
"emmetPreferencesCssWebkitProperties": "Comma separated css properties that get webkit vendor prefix when used in emmet abbreviation that starts with `-`. Set to empty string to avoid webkit prefix always.",
|
||||
"emmetPreferencesCssMozProperties": "Comma separated css properties that get moz vendor prefix when used in emmet abbreviation that starts with `-`. Set to empty string to avoid moz prefix always.",
|
||||
"emmetPreferencesCssOProperties": "Comma separated css properties that get o vendor prefix when used in emmet abbreviation that starts with `-`. Set to empty string to avoid o prefix always.",
|
||||
"emmetPreferencesCssMsProperties": "Comma separated css properties that get ms vendor prefix when used in emmet abbreviation that starts with `-`. Set to empty string to avoid ms prefix always."
|
||||
}
|
||||
|
|
|
@ -47,10 +47,10 @@ export const LANGUAGE_MODES: any = {
|
|||
'haml': ['!', '.', '}', ':', '*', '$', ']', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
|
||||
'xml': ['.', '}', '*', '$', ']', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
|
||||
'xsl': ['!', '.', '}', '*', '$', ']', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
|
||||
'css': [':', ';', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
|
||||
'scss': [':', ';', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
|
||||
'css': [':', '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
|
||||
'scss': [':', '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
|
||||
'sass': [':', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
|
||||
'less': [':', ';', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
|
||||
'less': [':', '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
|
||||
'stylus': [':', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
|
||||
'javascriptreact': ['.', '}', '*', '$', ']', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
|
||||
'typescriptreact': ['.', '}', '*', '$', ']', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
|
||||
|
|
|
@ -2052,9 +2052,9 @@ vinyl@~2.0.1:
|
|||
remove-trailing-separator "^1.0.1"
|
||||
replace-ext "^1.0.0"
|
||||
|
||||
vscode-emmet-helper@^1.1.22:
|
||||
version "1.1.22"
|
||||
resolved "https://registry.yarnpkg.com/vscode-emmet-helper/-/vscode-emmet-helper-1.1.22.tgz#3ba407f98e60d1153a8f1ed073ccaaa2587d2771"
|
||||
vscode-emmet-helper@^1.1.24:
|
||||
version "1.1.24"
|
||||
resolved "https://registry.yarnpkg.com/vscode-emmet-helper/-/vscode-emmet-helper-1.1.24.tgz#032d3aa3a3e30ed87b7056a902300f1e0eb4016d"
|
||||
dependencies:
|
||||
"@emmetio/extract-abbreviation" "^0.1.4"
|
||||
jsonc-parser "^1.0.0"
|
||||
|
@ -2068,9 +2068,9 @@ vscode-languageserver-types@^3.5.0:
|
|||
version "3.5.0"
|
||||
resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.5.0.tgz#e48d79962f0b8e02de955e3f524908e2b19c0374"
|
||||
|
||||
vscode-nls@3.1.2:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.1.2.tgz#c1b63f4338ac49c852267633dd99717916424a74"
|
||||
vscode-nls@3.2.1:
|
||||
version "3.2.1"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.2.1.tgz#b1f3e04e8a94a715d5a7bcbc8339c51e6d74ca51"
|
||||
|
||||
vscode@1.0.1:
|
||||
version "1.0.1"
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
"jsonc-parser": "^1.0.0",
|
||||
"markdown-it": "^8.3.1",
|
||||
"parse5": "^3.0.2",
|
||||
"vscode-nls": "^3.1.2"
|
||||
"vscode-nls": "^3.2.1"
|
||||
},
|
||||
"contributes": {
|
||||
"jsonValidation": [
|
||||
|
|
|
@ -58,6 +58,6 @@ uc.micro@^1.0.1, uc.micro@^1.0.3:
|
|||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/uc.micro/-/uc.micro-1.0.3.tgz#7ed50d5e0f9a9fb0a573379259f2a77458d50192"
|
||||
|
||||
vscode-nls@^3.1.2:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.1.2.tgz#c1b63f4338ac49c852267633dd99717916424a74"
|
||||
vscode-nls@^3.2.1:
|
||||
version "3.2.1"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.2.1.tgz#b1f3e04e8a94a715d5a7bcbc8339c51e6d74ca51"
|
||||
|
|
|
@ -336,35 +336,35 @@
|
|||
},
|
||||
{
|
||||
"command": "git.close",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.refresh",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.openFile",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.openHEADFile",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.openChange",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.stage",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.stageAll",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.stageSelectedRanges",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.stageChange",
|
||||
|
@ -372,7 +372,7 @@
|
|||
},
|
||||
{
|
||||
"command": "git.revertSelectedRanges",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.revertChange",
|
||||
|
@ -384,147 +384,147 @@
|
|||
},
|
||||
{
|
||||
"command": "git.unstage",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.unstageAll",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.unstageSelectedRanges",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.clean",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.cleanAll",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.commit",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.commitStaged",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.commitStagedSigned",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.commitStagedAmend",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.commitAll",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.commitAllSigned",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.commitAllAmend",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.undoCommit",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.checkout",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.branch",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.deleteBranch",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.renameBranch",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.pull",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.pullFrom",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.pullRebase",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.pullFrom",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.merge",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.createTag",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.fetch",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.push",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.pushTo",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.pushWithTags",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.sync",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.syncRebase",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.publish",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.showOutput",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.ignore",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.stashIncludeUntracked",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.stash",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.stashPop",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
},
|
||||
{
|
||||
"command": "git.stashPopLatest",
|
||||
"when": "gitOpenRepositoryCount != 0"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
|
||||
}
|
||||
],
|
||||
"scm/title": [
|
||||
|
@ -809,27 +809,27 @@
|
|||
{
|
||||
"command": "git.openFile",
|
||||
"group": "navigation",
|
||||
"when": "gitOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme != extension && resourceScheme != merge-conflict.conflict-diff"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme != extension && resourceScheme != merge-conflict.conflict-diff"
|
||||
},
|
||||
{
|
||||
"command": "git.openChange",
|
||||
"group": "navigation",
|
||||
"when": "gitOpenRepositoryCount != 0 && !isInDiffEditor && resourceScheme == file"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0 && !isInDiffEditor && resourceScheme == file"
|
||||
},
|
||||
{
|
||||
"command": "git.stageSelectedRanges",
|
||||
"group": "2_git@1",
|
||||
"when": "gitOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme != merge-conflict.conflict-diff"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme != merge-conflict.conflict-diff"
|
||||
},
|
||||
{
|
||||
"command": "git.unstageSelectedRanges",
|
||||
"group": "2_git@2",
|
||||
"when": "gitOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme != merge-conflict.conflict-diff"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme != merge-conflict.conflict-diff"
|
||||
},
|
||||
{
|
||||
"command": "git.revertSelectedRanges",
|
||||
"group": "2_git@3",
|
||||
"when": "gitOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme != merge-conflict.conflict-diff"
|
||||
"when": "config.git.enabled && gitOpenRepositoryCount != 0 && isInDiffEditor && resourceScheme != merge-conflict.conflict-diff"
|
||||
}
|
||||
],
|
||||
"scm/change/title": [
|
||||
|
@ -946,6 +946,22 @@
|
|||
"type": "boolean",
|
||||
"default": true,
|
||||
"description": "%config.showInlineOpenFileAction%"
|
||||
},
|
||||
"git.inputValidation": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"always",
|
||||
"warn",
|
||||
"off"
|
||||
],
|
||||
"default": "warn",
|
||||
"description": "%config.inputValidation%"
|
||||
},
|
||||
"git.detectSubmodules": {
|
||||
"type": "boolean",
|
||||
"scope": "resource",
|
||||
"default": true,
|
||||
"description": "%config.detectSubmodules%"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -1010,8 +1026,8 @@
|
|||
"byline": "^5.0.0",
|
||||
"file-type": "^7.2.0",
|
||||
"iconv-lite": "0.4.19",
|
||||
"vscode-extension-telemetry": "0.0.8",
|
||||
"vscode-nls": "^3.1.2",
|
||||
"vscode-extension-telemetry": "0.0.11",
|
||||
"vscode-nls": "^3.2.1",
|
||||
"which": "^1.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
@ -66,6 +66,8 @@
|
|||
"config.decorations.enabled": "Controls if Git contributes colors and badges to the explorer and the open editors view.",
|
||||
"config.promptToSaveFilesBeforeCommit": "Controls whether Git should check for unsaved files before committing.",
|
||||
"config.showInlineOpenFileAction": "Controls whether to show an inline Open File action in the Git changes view.",
|
||||
"config.inputValidation": "Controls when to show input validation the input counter.",
|
||||
"config.detectSubmodules": "Controls whether to automatically detect git submodules.",
|
||||
"colors.modified": "Color for modified resources.",
|
||||
"colors.deleted": "Color for deleted resources.",
|
||||
"colors.untracked": "Color for untracked resources.",
|
||||
|
|
|
@ -14,7 +14,7 @@ import { CommandCenter } from './commands';
|
|||
import { GitContentProvider } from './contentProvider';
|
||||
import { GitDecorations } from './decorationProvider';
|
||||
import { Askpass } from './askpass';
|
||||
import { toDisposable } from './util';
|
||||
import { toDisposable, filterEvent, mapEvent, eventToPromise } from './util';
|
||||
import TelemetryReporter from 'vscode-extension-telemetry';
|
||||
import { API, createApi } from './api';
|
||||
|
||||
|
@ -93,11 +93,27 @@ async function _activate(context: ExtensionContext, disposables: Disposable[]):
|
|||
}
|
||||
|
||||
export function activate(context: ExtensionContext): API {
|
||||
const config = workspace.getConfiguration('git', null);
|
||||
const enabled = config.get<boolean>('enabled');
|
||||
|
||||
const disposables: Disposable[] = [];
|
||||
context.subscriptions.push(new Disposable(() => Disposable.from(...disposables).dispose()));
|
||||
|
||||
const activatePromise = _activate(context, disposables);
|
||||
const modelPromise = activatePromise.then(model => model || Promise.reject<Model>('Git model not found'));
|
||||
let activatePromise: Promise<Model | undefined>;
|
||||
|
||||
if (enabled) {
|
||||
activatePromise = _activate(context, disposables);
|
||||
} else {
|
||||
const onConfigChange = filterEvent(workspace.onDidChangeConfiguration, e => e.affectsConfiguration('git'));
|
||||
const onEnabled = filterEvent(onConfigChange, () => workspace.getConfiguration('git', null).get<boolean>('enabled') === true);
|
||||
|
||||
activatePromise = eventToPromise(onEnabled)
|
||||
.then(() => _activate(context, disposables));
|
||||
}
|
||||
|
||||
const modelPromise = activatePromise
|
||||
.then(model => model || Promise.reject<Model>('Git model not found'));
|
||||
|
||||
activatePromise.catch(err => console.error(err));
|
||||
|
||||
return createApi(modelPromise);
|
||||
|
|
|
@ -191,11 +191,13 @@ export class Model {
|
|||
}
|
||||
|
||||
try {
|
||||
const repositoryRoot = await this.git.getRepositoryRoot(path);
|
||||
const rawRoot = await this.git.getRepositoryRoot(path);
|
||||
|
||||
// This can happen whenever `path` has the wrong case sensitivity in
|
||||
// case insensitive file systems
|
||||
// https://github.com/Microsoft/vscode/issues/33498
|
||||
const repositoryRoot = Uri.file(rawRoot).fsPath;
|
||||
|
||||
if (this.getRepository(repositoryRoot)) {
|
||||
return;
|
||||
}
|
||||
|
@ -217,14 +219,9 @@ export class Model {
|
|||
const disappearListener = onDidDisappearRepository(() => dispose());
|
||||
const changeListener = repository.onDidChangeRepository(uri => this._onDidChangeRepository.fire({ repository, uri }));
|
||||
const originalResourceChangeListener = repository.onDidChangeOriginalResource(uri => this._onDidChangeOriginalResource.fire({ repository, uri }));
|
||||
const scanSubmodules = () => {
|
||||
repository.submodules
|
||||
.map(r => path.join(repository.root, r.path))
|
||||
.forEach(p => this.eventuallyScanPossibleGitRepository(p));
|
||||
};
|
||||
|
||||
const statusListener = repository.onDidRunGitStatus(scanSubmodules);
|
||||
scanSubmodules();
|
||||
const statusListener = repository.onDidRunGitStatus(() => this.scanSubmodules(repository));
|
||||
this.scanSubmodules(repository);
|
||||
|
||||
const dispose = () => {
|
||||
disappearListener.dispose();
|
||||
|
@ -242,6 +239,20 @@ export class Model {
|
|||
this._onDidOpenRepository.fire(repository);
|
||||
}
|
||||
|
||||
private scanSubmodules(repository: Repository): void {
|
||||
const shouldScanSubmodules = workspace
|
||||
.getConfiguration('git', Uri.file(repository.root))
|
||||
.get<boolean>('detectSubmodules') === true;
|
||||
|
||||
if (!shouldScanSubmodules) {
|
||||
return;
|
||||
}
|
||||
|
||||
repository.submodules
|
||||
.map(r => path.join(repository.root, r.path))
|
||||
.forEach(p => this.eventuallyScanPossibleGitRepository(p));
|
||||
}
|
||||
|
||||
close(repository: Repository): void {
|
||||
const openRepository = this.getOpenRepository(repository);
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
import { Uri, Command, EventEmitter, Event, scm, SourceControl, SourceControlInputBox, SourceControlResourceGroup, SourceControlResourceState, SourceControlResourceDecorations, Disposable, ProgressLocation, window, workspace, WorkspaceEdit, ThemeColor, DecorationData, Memento } from 'vscode';
|
||||
import { Uri, Command, EventEmitter, Event, scm, SourceControl, SourceControlInputBox, SourceControlResourceGroup, SourceControlResourceState, SourceControlResourceDecorations, SourceControlInputBoxValidation, Disposable, ProgressLocation, window, workspace, WorkspaceEdit, ThemeColor, DecorationData, Memento, SourceControlInputBoxValidationType } from 'vscode';
|
||||
import { Repository as BaseRepository, Ref, Branch, Remote, Commit, GitErrorCodes, Stash, RefType, GitError, Submodule, DiffOptions } from './git';
|
||||
import { anyEvent, filterEvent, eventToPromise, dispose, find, isDescendant, IDisposable, onceEvent, EmptyDisposable, debounceEvent } from './util';
|
||||
import { memoize, throttle, debounce } from './decorators';
|
||||
|
@ -419,6 +419,8 @@ class ProgressManager {
|
|||
|
||||
export class Repository implements Disposable {
|
||||
|
||||
private static readonly InputValidationLength = 72;
|
||||
|
||||
private _onDidChangeRepository = new EventEmitter<Uri>();
|
||||
readonly onDidChangeRepository: Event<Uri> = this._onDidChangeRepository.event;
|
||||
|
||||
|
@ -521,7 +523,7 @@ export class Repository implements Disposable {
|
|||
this._sourceControl.inputBox.placeholder = localize('commitMessage', "Message (press {0} to commit)");
|
||||
this._sourceControl.acceptInputCommand = { command: 'git.commitWithInput', title: localize('commit', "Commit"), arguments: [this._sourceControl] };
|
||||
this._sourceControl.quickDiffProvider = this;
|
||||
this._sourceControl.inputBox.lineWarningLength = 72;
|
||||
this._sourceControl.inputBox.validateInput = this.validateInput.bind(this);
|
||||
this.disposables.push(this._sourceControl);
|
||||
|
||||
this._mergeGroup = this._sourceControl.createResourceGroup('merge', localize('merge changes', "Merge Changes"));
|
||||
|
@ -549,6 +551,43 @@ export class Repository implements Disposable {
|
|||
this.status();
|
||||
}
|
||||
|
||||
validateInput(text: string, position: number): SourceControlInputBoxValidation | undefined {
|
||||
const config = workspace.getConfiguration('git');
|
||||
const setting = config.get<'always' | 'warn' | 'off'>('inputValidation');
|
||||
|
||||
if (setting === 'off') {
|
||||
return;
|
||||
}
|
||||
|
||||
let start = 0, end;
|
||||
let match: RegExpExecArray | null;
|
||||
const regex = /\r?\n/g;
|
||||
|
||||
while ((match = regex.exec(text)) && position > match.index) {
|
||||
start = match.index + match[0].length;
|
||||
}
|
||||
|
||||
end = match ? match.index : text.length;
|
||||
|
||||
const line = text.substring(start, end);
|
||||
|
||||
if (line.length <= Repository.InputValidationLength) {
|
||||
if (setting !== 'always') {
|
||||
return;
|
||||
}
|
||||
|
||||
return {
|
||||
message: localize('commitMessageCountdown', "{0} characters left in current line", Repository.InputValidationLength - line.length),
|
||||
type: SourceControlInputBoxValidationType.Information
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
message: localize('commitMessageWarning', "{0} characters over {1} in current line", line.length - Repository.InputValidationLength, Repository.InputValidationLength),
|
||||
type: SourceControlInputBoxValidationType.Warning
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
provideOriginalResource(uri: Uri): Uri | undefined {
|
||||
if (uri.scheme !== 'file') {
|
||||
return;
|
||||
|
|
|
@ -30,9 +30,13 @@
|
|||
version "1.0.28"
|
||||
resolved "https://registry.yarnpkg.com/@types/which/-/which-1.0.28.tgz#016e387629b8817bed653fe32eab5d11279c8df6"
|
||||
|
||||
applicationinsights@0.18.0:
|
||||
version "0.18.0"
|
||||
resolved "https://registry.yarnpkg.com/applicationinsights/-/applicationinsights-0.18.0.tgz#162ebb48a383408bc4de44db32b417307f45bbc1"
|
||||
applicationinsights@1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/applicationinsights/-/applicationinsights-1.0.1.tgz#53446b830fe8d5d619eee2a278b31d3d25030927"
|
||||
dependencies:
|
||||
diagnostic-channel "0.2.0"
|
||||
diagnostic-channel-publishers "0.2.1"
|
||||
zone.js "0.7.6"
|
||||
|
||||
balanced-match@^1.0.0:
|
||||
version "1.0.0"
|
||||
|
@ -69,6 +73,16 @@ debug@2.6.8:
|
|||
dependencies:
|
||||
ms "2.0.0"
|
||||
|
||||
diagnostic-channel-publishers@0.2.1:
|
||||
version "0.2.1"
|
||||
resolved "https://registry.yarnpkg.com/diagnostic-channel-publishers/-/diagnostic-channel-publishers-0.2.1.tgz#8e2d607a8b6d79fe880b548bc58cc6beb288c4f3"
|
||||
|
||||
diagnostic-channel@0.2.0:
|
||||
version "0.2.0"
|
||||
resolved "https://registry.yarnpkg.com/diagnostic-channel/-/diagnostic-channel-0.2.0.tgz#cc99af9612c23fb1fff13612c72f2cbfaa8d5a17"
|
||||
dependencies:
|
||||
semver "^5.3.0"
|
||||
|
||||
diff@3.2.0:
|
||||
version "3.2.0"
|
||||
resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9"
|
||||
|
@ -229,22 +243,25 @@ path-is-absolute@^1.0.0:
|
|||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
|
||||
|
||||
semver@^5.3.0:
|
||||
version "5.5.0"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab"
|
||||
|
||||
supports-color@3.1.2:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.1.2.tgz#72a262894d9d408b956ca05ff37b2ed8a6e2a2d5"
|
||||
dependencies:
|
||||
has-flag "^1.0.0"
|
||||
|
||||
vscode-extension-telemetry@0.0.8:
|
||||
version "0.0.8"
|
||||
resolved "https://registry.yarnpkg.com/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.8.tgz#2261bff986b6690a6f1f746a45ac5bd1f85d29e0"
|
||||
vscode-extension-telemetry@0.0.11:
|
||||
version "0.0.11"
|
||||
resolved "https://registry.yarnpkg.com/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.11.tgz#f2dde487f01d2b079f55ab47a0247f5a772c4e06"
|
||||
dependencies:
|
||||
applicationinsights "0.18.0"
|
||||
winreg "1.2.3"
|
||||
applicationinsights "1.0.1"
|
||||
|
||||
vscode-nls@^3.1.2:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.1.2.tgz#c1b63f4338ac49c852267633dd99717916424a74"
|
||||
vscode-nls@^3.2.1:
|
||||
version "3.2.1"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.2.1.tgz#b1f3e04e8a94a715d5a7bcbc8339c51e6d74ca51"
|
||||
|
||||
which@^1.3.0:
|
||||
version "1.3.0"
|
||||
|
@ -252,10 +269,10 @@ which@^1.3.0:
|
|||
dependencies:
|
||||
isexe "^2.0.0"
|
||||
|
||||
winreg@1.2.3:
|
||||
version "1.2.3"
|
||||
resolved "https://registry.yarnpkg.com/winreg/-/winreg-1.2.3.tgz#93ad116b2696da87d58f7265a8fcea5254a965d5"
|
||||
|
||||
wrappy@1:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
|
||||
|
||||
zone.js@0.7.6:
|
||||
version "0.7.6"
|
||||
resolved "https://registry.yarnpkg.com/zone.js/-/zone.js-0.7.6.tgz#fbbc39d3e0261d0986f1ba06306eb3aeb0d22009"
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
"watch": "gulp watch-extension:grunt"
|
||||
},
|
||||
"dependencies": {
|
||||
"vscode-nls": "^3.1.2"
|
||||
"vscode-nls": "^3.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "7.0.43"
|
||||
|
|
|
@ -6,6 +6,6 @@
|
|||
version "7.0.43"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.43.tgz#a187e08495a075f200ca946079c914e1a5fe962c"
|
||||
|
||||
vscode-nls@^3.1.2:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.1.2.tgz#c1b63f4338ac49c852267633dd99717916424a74"
|
||||
vscode-nls@^3.2.1:
|
||||
version "3.2.1"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.2.1.tgz#b1f3e04e8a94a715d5a7bcbc8339c51e6d74ca51"
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
"watch": "gulp watch-extension:gulp"
|
||||
},
|
||||
"dependencies": {
|
||||
"vscode-nls": "^3.1.2"
|
||||
"vscode-nls": "^3.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "7.0.43"
|
||||
|
|
|
@ -6,6 +6,6 @@
|
|||
version "7.0.43"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.43.tgz#a187e08495a075f200ca946079c914e1a5fe962c"
|
||||
|
||||
vscode-nls@^3.1.2:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.1.2.tgz#c1b63f4338ac49c852267633dd99717916424a74"
|
||||
vscode-nls@^3.2.1:
|
||||
version "3.2.1"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.2.1.tgz#b1f3e04e8a94a715d5a7bcbc8339c51e6d74ca51"
|
||||
|
|
|
@ -224,9 +224,9 @@
|
|||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"vscode-extension-telemetry": "0.0.8",
|
||||
"vscode-extension-telemetry": "0.0.11",
|
||||
"vscode-languageclient": "^3.5.0",
|
||||
"vscode-nls": "^3.1.2"
|
||||
"vscode-nls": "^3.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "7.0.43"
|
||||
|
|
|
@ -8,10 +8,10 @@
|
|||
"node": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"vscode-css-languageservice": "^3.0.3",
|
||||
"vscode-html-languageservice": "^2.0.14",
|
||||
"vscode-css-languageservice": "^3.0.5",
|
||||
"vscode-html-languageservice": "^2.0.15",
|
||||
"vscode-languageserver": "^3.5.0",
|
||||
"vscode-nls": "^3.1.2",
|
||||
"vscode-nls": "^3.2.1",
|
||||
"vscode-uri": "^1.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
@ -10,16 +10,16 @@
|
|||
version "7.0.43"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.43.tgz#a187e08495a075f200ca946079c914e1a5fe962c"
|
||||
|
||||
vscode-css-languageservice@^3.0.3:
|
||||
version "3.0.3"
|
||||
resolved "https://registry.yarnpkg.com/vscode-css-languageservice/-/vscode-css-languageservice-3.0.3.tgz#02cc4efa5335f5104e0a2f3b6920faaf59db4f7a"
|
||||
vscode-css-languageservice@^3.0.5:
|
||||
version "3.0.5"
|
||||
resolved "https://registry.yarnpkg.com/vscode-css-languageservice/-/vscode-css-languageservice-3.0.5.tgz#8470989c07bbe740db4fa621423e98384d2c342f"
|
||||
dependencies:
|
||||
vscode-languageserver-types "3.5.0"
|
||||
vscode-nls "^2.0.1"
|
||||
|
||||
vscode-html-languageservice@^2.0.14:
|
||||
version "2.0.14"
|
||||
resolved "https://registry.yarnpkg.com/vscode-html-languageservice/-/vscode-html-languageservice-2.0.14.tgz#15491c11bb7e196f6fd03b6c6c768901935862eb"
|
||||
vscode-html-languageservice@^2.0.15:
|
||||
version "2.0.15"
|
||||
resolved "https://registry.yarnpkg.com/vscode-html-languageservice/-/vscode-html-languageservice-2.0.15.tgz#e3ec34c4d62bc636f8a16c9b474e5851ca13aab0"
|
||||
dependencies:
|
||||
vscode-languageserver-types "3.5.0"
|
||||
vscode-nls "^2.0.2"
|
||||
|
@ -51,9 +51,9 @@ vscode-nls@^2.0.1, vscode-nls@^2.0.2:
|
|||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-2.0.2.tgz#808522380844b8ad153499af5c3b03921aea02da"
|
||||
|
||||
vscode-nls@^3.1.2:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.1.2.tgz#c1b63f4338ac49c852267633dd99717916424a74"
|
||||
vscode-nls@^3.2.1:
|
||||
version "3.2.1"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.2.1.tgz#b1f3e04e8a94a715d5a7bcbc8339c51e6d74ca51"
|
||||
|
||||
vscode-uri@^1.0.1:
|
||||
version "1.0.1"
|
||||
|
|
|
@ -6,16 +6,33 @@
|
|||
version "7.0.43"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.43.tgz#a187e08495a075f200ca946079c914e1a5fe962c"
|
||||
|
||||
applicationinsights@0.18.0:
|
||||
version "0.18.0"
|
||||
resolved "https://registry.yarnpkg.com/applicationinsights/-/applicationinsights-0.18.0.tgz#162ebb48a383408bc4de44db32b417307f45bbc1"
|
||||
|
||||
vscode-extension-telemetry@0.0.8:
|
||||
version "0.0.8"
|
||||
resolved "https://registry.yarnpkg.com/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.8.tgz#2261bff986b6690a6f1f746a45ac5bd1f85d29e0"
|
||||
applicationinsights@1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/applicationinsights/-/applicationinsights-1.0.1.tgz#53446b830fe8d5d619eee2a278b31d3d25030927"
|
||||
dependencies:
|
||||
applicationinsights "0.18.0"
|
||||
winreg "1.2.3"
|
||||
diagnostic-channel "0.2.0"
|
||||
diagnostic-channel-publishers "0.2.1"
|
||||
zone.js "0.7.6"
|
||||
|
||||
diagnostic-channel-publishers@0.2.1:
|
||||
version "0.2.1"
|
||||
resolved "https://registry.yarnpkg.com/diagnostic-channel-publishers/-/diagnostic-channel-publishers-0.2.1.tgz#8e2d607a8b6d79fe880b548bc58cc6beb288c4f3"
|
||||
|
||||
diagnostic-channel@0.2.0:
|
||||
version "0.2.0"
|
||||
resolved "https://registry.yarnpkg.com/diagnostic-channel/-/diagnostic-channel-0.2.0.tgz#cc99af9612c23fb1fff13612c72f2cbfaa8d5a17"
|
||||
dependencies:
|
||||
semver "^5.3.0"
|
||||
|
||||
semver@^5.3.0:
|
||||
version "5.5.0"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab"
|
||||
|
||||
vscode-extension-telemetry@0.0.11:
|
||||
version "0.0.11"
|
||||
resolved "https://registry.yarnpkg.com/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.11.tgz#f2dde487f01d2b079f55ab47a0247f5a772c4e06"
|
||||
dependencies:
|
||||
applicationinsights "1.0.1"
|
||||
|
||||
vscode-jsonrpc@^3.5.0:
|
||||
version "3.5.0"
|
||||
|
@ -38,10 +55,10 @@ vscode-languageserver-types@^3.5.0:
|
|||
version "3.5.0"
|
||||
resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.5.0.tgz#e48d79962f0b8e02de955e3f524908e2b19c0374"
|
||||
|
||||
vscode-nls@^3.1.2:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.1.2.tgz#c1b63f4338ac49c852267633dd99717916424a74"
|
||||
vscode-nls@^3.2.1:
|
||||
version "3.2.1"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.2.1.tgz#b1f3e04e8a94a715d5a7bcbc8339c51e6d74ca51"
|
||||
|
||||
winreg@1.2.3:
|
||||
version "1.2.3"
|
||||
resolved "https://registry.yarnpkg.com/winreg/-/winreg-1.2.3.tgz#93ad116b2696da87d58f7265a8fcea5254a965d5"
|
||||
zone.js@0.7.6:
|
||||
version "0.7.6"
|
||||
resolved "https://registry.yarnpkg.com/zone.js/-/zone.js-0.7.6.tgz#fbbc39d3e0261d0986f1ba06306eb3aeb0d22009"
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
"watch": "gulp watch-extension:jake"
|
||||
},
|
||||
"dependencies": {
|
||||
"vscode-nls": "^3.1.2"
|
||||
"vscode-nls": "^3.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "7.0.43"
|
||||
|
|
|
@ -6,6 +6,6 @@
|
|||
version "7.0.43"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.43.tgz#a187e08495a075f200ca946079c914e1a5fe962c"
|
||||
|
||||
vscode-nls@^3.1.2:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.1.2.tgz#c1b63f4338ac49c852267633dd99717916424a74"
|
||||
vscode-nls@^3.2.1:
|
||||
version "3.2.1"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.2.1.tgz#b1f3e04e8a94a715d5a7bcbc8339c51e6d74ca51"
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"dependencies": {
|
||||
"jsonc-parser": "^1.0.0",
|
||||
"request-light": "^0.2.2",
|
||||
"vscode-nls": "^3.1.2"
|
||||
"vscode-nls": "^3.2.1"
|
||||
},
|
||||
"scripts": {
|
||||
"compile": "gulp compile-extension:javascript",
|
||||
|
|
|
@ -72,6 +72,6 @@ vscode-nls@^2.0.2:
|
|||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-2.0.2.tgz#808522380844b8ad153499af5c3b03921aea02da"
|
||||
|
||||
vscode-nls@^3.1.2:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.1.2.tgz#c1b63f4338ac49c852267633dd99717916424a74"
|
||||
vscode-nls@^3.2.1:
|
||||
version "3.2.1"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.2.1.tgz#b1f3e04e8a94a715d5a7bcbc8339c51e6d74ca51"
|
||||
|
|
|
@ -162,9 +162,9 @@
|
|||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"vscode-extension-telemetry": "0.0.8",
|
||||
"vscode-extension-telemetry": "0.0.11",
|
||||
"vscode-languageclient": "^3.5.0",
|
||||
"vscode-nls": "^3.1.2"
|
||||
"vscode-nls": "^3.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "7.0.43"
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
"request-light": "^0.2.2",
|
||||
"vscode-json-languageservice": "^3.0.4",
|
||||
"vscode-languageserver": "^3.5.0",
|
||||
"vscode-nls": "^3.1.2",
|
||||
"vscode-nls": "^3.2.1",
|
||||
"vscode-uri": "^1.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
@ -99,9 +99,9 @@ vscode-nls@^2.0.2:
|
|||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-2.0.2.tgz#808522380844b8ad153499af5c3b03921aea02da"
|
||||
|
||||
vscode-nls@^3.1.2:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.1.2.tgz#c1b63f4338ac49c852267633dd99717916424a74"
|
||||
vscode-nls@^3.2.1:
|
||||
version "3.2.1"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.2.1.tgz#b1f3e04e8a94a715d5a7bcbc8339c51e6d74ca51"
|
||||
|
||||
vscode-uri@^1.0.1:
|
||||
version "1.0.1"
|
||||
|
|
|
@ -6,16 +6,33 @@
|
|||
version "7.0.43"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.43.tgz#a187e08495a075f200ca946079c914e1a5fe962c"
|
||||
|
||||
applicationinsights@0.18.0:
|
||||
version "0.18.0"
|
||||
resolved "https://registry.yarnpkg.com/applicationinsights/-/applicationinsights-0.18.0.tgz#162ebb48a383408bc4de44db32b417307f45bbc1"
|
||||
|
||||
vscode-extension-telemetry@0.0.8:
|
||||
version "0.0.8"
|
||||
resolved "https://registry.yarnpkg.com/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.8.tgz#2261bff986b6690a6f1f746a45ac5bd1f85d29e0"
|
||||
applicationinsights@1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/applicationinsights/-/applicationinsights-1.0.1.tgz#53446b830fe8d5d619eee2a278b31d3d25030927"
|
||||
dependencies:
|
||||
applicationinsights "0.18.0"
|
||||
winreg "1.2.3"
|
||||
diagnostic-channel "0.2.0"
|
||||
diagnostic-channel-publishers "0.2.1"
|
||||
zone.js "0.7.6"
|
||||
|
||||
diagnostic-channel-publishers@0.2.1:
|
||||
version "0.2.1"
|
||||
resolved "https://registry.yarnpkg.com/diagnostic-channel-publishers/-/diagnostic-channel-publishers-0.2.1.tgz#8e2d607a8b6d79fe880b548bc58cc6beb288c4f3"
|
||||
|
||||
diagnostic-channel@0.2.0:
|
||||
version "0.2.0"
|
||||
resolved "https://registry.yarnpkg.com/diagnostic-channel/-/diagnostic-channel-0.2.0.tgz#cc99af9612c23fb1fff13612c72f2cbfaa8d5a17"
|
||||
dependencies:
|
||||
semver "^5.3.0"
|
||||
|
||||
semver@^5.3.0:
|
||||
version "5.5.0"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab"
|
||||
|
||||
vscode-extension-telemetry@0.0.11:
|
||||
version "0.0.11"
|
||||
resolved "https://registry.yarnpkg.com/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.11.tgz#f2dde487f01d2b079f55ab47a0247f5a772c4e06"
|
||||
dependencies:
|
||||
applicationinsights "1.0.1"
|
||||
|
||||
vscode-jsonrpc@^3.5.0:
|
||||
version "3.5.0"
|
||||
|
@ -38,10 +55,10 @@ vscode-languageserver-types@^3.5.0:
|
|||
version "3.5.0"
|
||||
resolved "https://registry.yarnpkg.com/vscode-languageserver-types/-/vscode-languageserver-types-3.5.0.tgz#e48d79962f0b8e02de955e3f524908e2b19c0374"
|
||||
|
||||
vscode-nls@^3.1.2:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.1.2.tgz#c1b63f4338ac49c852267633dd99717916424a74"
|
||||
vscode-nls@^3.2.1:
|
||||
version "3.2.1"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.2.1.tgz#b1f3e04e8a94a715d5a7bcbc8339c51e6d74ca51"
|
||||
|
||||
winreg@1.2.3:
|
||||
version "1.2.3"
|
||||
resolved "https://registry.yarnpkg.com/winreg/-/winreg-1.2.3.tgz#93ad116b2696da87d58f7265a8fcea5254a965d5"
|
||||
zone.js@0.7.6:
|
||||
version "0.7.6"
|
||||
resolved "https://registry.yarnpkg.com/zone.js/-/zone.js-0.7.6.tgz#fbbc39d3e0261d0986f1ba06306eb3aeb0d22009"
|
||||
|
|
|
@ -92,7 +92,10 @@
|
|||
"commands": [
|
||||
{
|
||||
"command": "markdown.showPreview",
|
||||
"title": "%markdown.preview.title%",
|
||||
"title": {
|
||||
"original": "Open Preview",
|
||||
"value": "%markdown.preview.title%"
|
||||
},
|
||||
"category": "Markdown",
|
||||
"icon": {
|
||||
"light": "./media/Preview.svg",
|
||||
|
@ -101,7 +104,10 @@
|
|||
},
|
||||
{
|
||||
"command": "markdown.showPreviewToSide",
|
||||
"title": "%markdown.previewSide.title%",
|
||||
"title": {
|
||||
"original": "Open Preview to the Side",
|
||||
"value": "%markdown.previewSide.title%"
|
||||
},
|
||||
"category": "Markdown",
|
||||
"icon": {
|
||||
"light": "./media/PreviewOnRightPane_16x.svg",
|
||||
|
@ -110,7 +116,10 @@
|
|||
},
|
||||
{
|
||||
"command": "markdown.showSource",
|
||||
"title": "%markdown.showSource.title%",
|
||||
"title": {
|
||||
"original": "Show Source",
|
||||
"value": "%markdown.showSource.title%"
|
||||
},
|
||||
"category": "Markdown",
|
||||
"icon": {
|
||||
"light": "./media/ViewSource.svg",
|
||||
|
@ -119,12 +128,18 @@
|
|||
},
|
||||
{
|
||||
"command": "markdown.refreshPreview",
|
||||
"title": "%markdown.refreshPreview.title%",
|
||||
"title": {
|
||||
"original": "Refresh Preview",
|
||||
"value": "%markdown.refreshPreview.title%"
|
||||
},
|
||||
"category": "Markdown"
|
||||
},
|
||||
{
|
||||
"command": "markdown.showPreviewSecuritySelector",
|
||||
"title": "%markdown.showPreviewSecuritySelector.title%",
|
||||
"title": {
|
||||
"original": "Change Preview Security Settings",
|
||||
"value": "%markdown.showPreviewSecuritySelector.title%"
|
||||
},
|
||||
"category": "Markdown"
|
||||
}
|
||||
],
|
||||
|
@ -313,8 +328,8 @@
|
|||
"highlight.js": "9.5.0",
|
||||
"markdown-it": "^8.4.0",
|
||||
"markdown-it-named-headers": "0.0.4",
|
||||
"vscode-extension-telemetry": "^0.0.8",
|
||||
"vscode-nls": "^3.1.2"
|
||||
"vscode-extension-telemetry": "^0.0.11",
|
||||
"vscode-nls": "^3.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/highlight.js": "9.1.10",
|
||||
|
@ -323,4 +338,4 @@
|
|||
"gulp-rename": "^1.2.2",
|
||||
"gulp-replace": "^0.5.4"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -127,7 +127,7 @@ export class PreviewSecuritySelector {
|
|||
label: this.cspArbiter.shouldDisableSecurityWarnings()
|
||||
? localize('enableSecurityWarning.title', "Enable preview security warnings in this workspace")
|
||||
: localize('disableSecurityWarning.title', "Disable preview security warning in this workspace"),
|
||||
description: localize('toggleSecurityWarning.description', 'Does not effect the content security level')
|
||||
description: localize('toggleSecurityWarning.description', 'Does not affect the content security level')
|
||||
},
|
||||
], {
|
||||
placeHolder: localize(
|
||||
|
|
|
@ -14,9 +14,13 @@
|
|||
version "7.0.43"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.43.tgz#a187e08495a075f200ca946079c914e1a5fe962c"
|
||||
|
||||
applicationinsights@0.18.0:
|
||||
version "0.18.0"
|
||||
resolved "https://registry.yarnpkg.com/applicationinsights/-/applicationinsights-0.18.0.tgz#162ebb48a383408bc4de44db32b417307f45bbc1"
|
||||
applicationinsights@1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/applicationinsights/-/applicationinsights-1.0.1.tgz#53446b830fe8d5d619eee2a278b31d3d25030927"
|
||||
dependencies:
|
||||
diagnostic-channel "0.2.0"
|
||||
diagnostic-channel-publishers "0.2.1"
|
||||
zone.js "0.7.6"
|
||||
|
||||
argparse@^1.0.7:
|
||||
version "1.0.9"
|
||||
|
@ -32,6 +36,16 @@ core-util-is@~1.0.0:
|
|||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
|
||||
|
||||
diagnostic-channel-publishers@0.2.1:
|
||||
version "0.2.1"
|
||||
resolved "https://registry.yarnpkg.com/diagnostic-channel-publishers/-/diagnostic-channel-publishers-0.2.1.tgz#8e2d607a8b6d79fe880b548bc58cc6beb288c4f3"
|
||||
|
||||
diagnostic-channel@0.2.0:
|
||||
version "0.2.0"
|
||||
resolved "https://registry.yarnpkg.com/diagnostic-channel/-/diagnostic-channel-0.2.0.tgz#cc99af9612c23fb1fff13612c72f2cbfaa8d5a17"
|
||||
dependencies:
|
||||
semver "^5.3.0"
|
||||
|
||||
entities@~1.1.1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.1.tgz#6e5c2d0a5621b5dadaecef80b90edfb5cd7772f0"
|
||||
|
@ -129,6 +143,10 @@ safe-buffer@~5.1.0, safe-buffer@~5.1.1:
|
|||
version "5.1.1"
|
||||
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853"
|
||||
|
||||
semver@^5.3.0:
|
||||
version "5.5.0"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab"
|
||||
|
||||
sprintf-js@~1.0.2:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
|
||||
|
@ -155,17 +173,16 @@ util-deprecate@~1.0.1:
|
|||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
|
||||
|
||||
vscode-extension-telemetry@^0.0.8:
|
||||
version "0.0.8"
|
||||
resolved "https://registry.yarnpkg.com/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.8.tgz#2261bff986b6690a6f1f746a45ac5bd1f85d29e0"
|
||||
vscode-extension-telemetry@^0.0.11:
|
||||
version "0.0.11"
|
||||
resolved "https://registry.yarnpkg.com/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.11.tgz#f2dde487f01d2b079f55ab47a0247f5a772c4e06"
|
||||
dependencies:
|
||||
applicationinsights "0.18.0"
|
||||
winreg "1.2.3"
|
||||
applicationinsights "1.0.1"
|
||||
|
||||
vscode-nls@^3.1.2:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.1.2.tgz#c1b63f4338ac49c852267633dd99717916424a74"
|
||||
vscode-nls@^3.2.1:
|
||||
version "3.2.1"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.2.1.tgz#b1f3e04e8a94a715d5a7bcbc8339c51e6d74ca51"
|
||||
|
||||
winreg@1.2.3:
|
||||
version "1.2.3"
|
||||
resolved "https://registry.yarnpkg.com/winreg/-/winreg-1.2.3.tgz#93ad116b2696da87d58f7265a8fcea5254a965d5"
|
||||
zone.js@0.7.6:
|
||||
version "0.7.6"
|
||||
resolved "https://registry.yarnpkg.com/zone.js/-/zone.js-0.7.6.tgz#fbbc39d3e0261d0986f1ba06306eb3aeb0d22009"
|
||||
|
|
|
@ -99,8 +99,8 @@
|
|||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"vscode-extension-telemetry": "0.0.8",
|
||||
"vscode-nls": "^3.1.2"
|
||||
"vscode-extension-telemetry": "0.0.11",
|
||||
"vscode-nls": "^3.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "8.0.33"
|
||||
|
|
|
@ -6,21 +6,38 @@
|
|||
version "8.0.33"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.33.tgz#1126e94374014e54478092830704f6ea89df04cd"
|
||||
|
||||
applicationinsights@0.18.0:
|
||||
version "0.18.0"
|
||||
resolved "https://registry.yarnpkg.com/applicationinsights/-/applicationinsights-0.18.0.tgz#162ebb48a383408bc4de44db32b417307f45bbc1"
|
||||
|
||||
vscode-extension-telemetry@0.0.8:
|
||||
version "0.0.8"
|
||||
resolved "https://registry.yarnpkg.com/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.8.tgz#2261bff986b6690a6f1f746a45ac5bd1f85d29e0"
|
||||
applicationinsights@1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/applicationinsights/-/applicationinsights-1.0.1.tgz#53446b830fe8d5d619eee2a278b31d3d25030927"
|
||||
dependencies:
|
||||
applicationinsights "0.18.0"
|
||||
winreg "1.2.3"
|
||||
diagnostic-channel "0.2.0"
|
||||
diagnostic-channel-publishers "0.2.1"
|
||||
zone.js "0.7.6"
|
||||
|
||||
vscode-nls@^3.1.2:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.1.2.tgz#c1b63f4338ac49c852267633dd99717916424a74"
|
||||
diagnostic-channel-publishers@0.2.1:
|
||||
version "0.2.1"
|
||||
resolved "https://registry.yarnpkg.com/diagnostic-channel-publishers/-/diagnostic-channel-publishers-0.2.1.tgz#8e2d607a8b6d79fe880b548bc58cc6beb288c4f3"
|
||||
|
||||
winreg@1.2.3:
|
||||
version "1.2.3"
|
||||
resolved "https://registry.yarnpkg.com/winreg/-/winreg-1.2.3.tgz#93ad116b2696da87d58f7265a8fcea5254a965d5"
|
||||
diagnostic-channel@0.2.0:
|
||||
version "0.2.0"
|
||||
resolved "https://registry.yarnpkg.com/diagnostic-channel/-/diagnostic-channel-0.2.0.tgz#cc99af9612c23fb1fff13612c72f2cbfaa8d5a17"
|
||||
dependencies:
|
||||
semver "^5.3.0"
|
||||
|
||||
semver@^5.3.0:
|
||||
version "5.5.0"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab"
|
||||
|
||||
vscode-extension-telemetry@0.0.11:
|
||||
version "0.0.11"
|
||||
resolved "https://registry.yarnpkg.com/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.11.tgz#f2dde487f01d2b079f55ab47a0247f5a772c4e06"
|
||||
dependencies:
|
||||
applicationinsights "1.0.1"
|
||||
|
||||
vscode-nls@^3.2.1:
|
||||
version "3.2.1"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.2.1.tgz#b1f3e04e8a94a715d5a7bcbc8339c51e6d74ca51"
|
||||
|
||||
zone.js@0.7.6:
|
||||
version "0.7.6"
|
||||
resolved "https://registry.yarnpkg.com/zone.js/-/zone.js-0.7.6.tgz#fbbc39d3e0261d0986f1ba06306eb3aeb0d22009"
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
"watch": "gulp watch-extension:npm"
|
||||
},
|
||||
"dependencies": {
|
||||
"vscode-nls": "^3.1.2"
|
||||
"vscode-nls": "^3.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "7.0.43"
|
||||
|
|
|
@ -6,6 +6,6 @@
|
|||
version "7.0.43"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.43.tgz#a187e08495a075f200ca946079c914e1a5fe962c"
|
||||
|
||||
vscode-nls@^3.1.2:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.1.2.tgz#c1b63f4338ac49c852267633dd99717916424a74"
|
||||
vscode-nls@^3.2.1:
|
||||
version "3.2.1"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.2.1.tgz#b1f3e04e8a94a715d5a7bcbc8339c51e6d74ca51"
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"version": "0.0.1",
|
||||
"description": "Dependencies shared by all extensions",
|
||||
"dependencies": {
|
||||
"typescript": "2.7.1-insiders.20180127"
|
||||
"typescript": "2.7.1"
|
||||
},
|
||||
"scripts": {
|
||||
"postinstall": "node ./postinstall"
|
||||
|
|
|
@ -20,6 +20,21 @@ function adaptInjectionScope(grammar) {
|
|||
injections[newInjectionKey] = injection;
|
||||
}
|
||||
|
||||
updateGrammar.update('atom/language-php', 'grammars/php.cson', './syntaxes/php.tmLanguage.json', undefined);
|
||||
// Workaround for https://github.com/Microsoft/vscode/issues/40279
|
||||
// and https://github.com/Microsoft/vscode-textmate/issues/59
|
||||
function fixBadRegex(grammar) {
|
||||
const scopeResolution = grammar.repository['scope-resolution'];
|
||||
if (scopeResolution) {
|
||||
const match = scopeResolution.patterns[0].match;
|
||||
if (match === '(?i)([a-z_\\x{7f}-\\x{7fffffff}\\\\][a-z0-9_\\x{7f}-\\x{7fffffff}\\\\]*)(?=\\s*::)') {
|
||||
scopeResolution.patterns[0].match = '([A-Za-z_\\x{7f}-\\x{7fffffff}\\\\][A_Za-z0-9_\\x{7f}-\\x{7fffffff}\\\\]*)(?=\\s*::)';
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
throw new Error(`fixBadRegex callback couldn't patch the regex. It may be obsolete`);
|
||||
}
|
||||
|
||||
updateGrammar.update('atom/language-php', 'grammars/php.cson', './syntaxes/php.tmLanguage.json', fixBadRegex);
|
||||
updateGrammar.update('atom/language-php', 'grammars/html.cson', './syntaxes/html.tmLanguage.json', adaptInjectionScope);
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
],
|
||||
"main": "./out/phpMain",
|
||||
"dependencies": {
|
||||
"vscode-nls": "^3.1.2"
|
||||
"vscode-nls": "^3.2.1"
|
||||
},
|
||||
"contributes": {
|
||||
"languages": [
|
||||
|
|
|
@ -2430,7 +2430,7 @@
|
|||
"scope-resolution": {
|
||||
"patterns": [
|
||||
{
|
||||
"match": "(?i)([a-z_\\x{7f}-\\x{7fffffff}\\\\][a-z0-9_\\x{7f}-\\x{7fffffff}\\\\]*)(?=\\s*::)",
|
||||
"match": "([A-Za-z_\\x{7f}-\\x{7fffffff}\\\\][A_Za-z0-9_\\x{7f}-\\x{7fffffff}\\\\]*)(?=\\s*::)",
|
||||
"captures": {
|
||||
"1": {
|
||||
"patterns": [
|
||||
|
|
|
@ -6,6 +6,6 @@
|
|||
version "7.0.43"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-7.0.43.tgz#a187e08495a075f200ca946079c914e1a5fe962c"
|
||||
|
||||
vscode-nls@^3.1.2:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.1.2.tgz#c1b63f4338ac49c852267633dd99717916424a74"
|
||||
vscode-nls@^3.2.1:
|
||||
version "3.2.1"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.2.1.tgz#b1f3e04e8a94a715d5a7bcbc8339c51e6d74ca51"
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"semver": "4.3.6",
|
||||
"vscode-extension-telemetry": "^0.0.8",
|
||||
"vscode-nls": "^3.1.2"
|
||||
"vscode-extension-telemetry": "^0.0.11",
|
||||
"vscode-nls": "^3.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "8.0.33",
|
||||
|
@ -445,37 +445,58 @@
|
|||
"commands": [
|
||||
{
|
||||
"command": "typescript.reloadProjects",
|
||||
"title": "%typescript.reloadProjects.title%",
|
||||
"title": {
|
||||
"original": "Reload Project",
|
||||
"value": "%typescript.reloadProjects.title%"
|
||||
},
|
||||
"category": "TypeScript"
|
||||
},
|
||||
{
|
||||
"command": "javascript.reloadProjects",
|
||||
"title": "%javascript.reloadProjects.title%",
|
||||
"title": {
|
||||
"original": "Reload Project",
|
||||
"value": "%javascript.reloadProjects.title%"
|
||||
},
|
||||
"category": "JavaScript"
|
||||
},
|
||||
{
|
||||
"command": "typescript.selectTypeScriptVersion",
|
||||
"title": "%typescript.selectTypeScriptVersion.title%",
|
||||
"title": {
|
||||
"original": "Select TypeScript Version",
|
||||
"value": "%typescript.selectTypeScriptVersion.title%"
|
||||
},
|
||||
"category": "TypeScript"
|
||||
},
|
||||
{
|
||||
"command": "typescript.goToProjectConfig",
|
||||
"title": "%typescript.goToProjectConfig.title%",
|
||||
"title": {
|
||||
"original": "Go to Project Configuration",
|
||||
"value": "%typescript.goToProjectConfig.title%"
|
||||
},
|
||||
"category": "TypeScript"
|
||||
},
|
||||
{
|
||||
"command": "javascript.goToProjectConfig",
|
||||
"title": "%javascript.goToProjectConfig.title%",
|
||||
"title": {
|
||||
"original": "Go to Project Configuration",
|
||||
"value": "%javascript.goToProjectConfig.title%"
|
||||
},
|
||||
"category": "JavaScript"
|
||||
},
|
||||
{
|
||||
"command": "typescript.openTsServerLog",
|
||||
"title": "%typescript.openTsServerLog.title%",
|
||||
"title": {
|
||||
"original": "Open TS Server log",
|
||||
"value": "%typescript.openTsServerLog.title%"
|
||||
},
|
||||
"category": "TypeScript"
|
||||
},
|
||||
{
|
||||
"command": "typescript.restartTsServer",
|
||||
"title": "%typescript.restartTsServer%",
|
||||
"title": {
|
||||
"original": "Restart TS server",
|
||||
"value": "%typescript.restartTsServer%"
|
||||
},
|
||||
"category": "TypeScript"
|
||||
}
|
||||
],
|
||||
|
|
|
@ -26,6 +26,7 @@ class MyCompletionItem extends CompletionItem {
|
|||
constructor(
|
||||
public readonly position: Position,
|
||||
public readonly document: TextDocument,
|
||||
line: string,
|
||||
public readonly tsEntry: Proto.CompletionEntry,
|
||||
enableDotCompletions: boolean,
|
||||
useCodeSnippetsOnMethodSuggest: boolean
|
||||
|
@ -61,6 +62,11 @@ class MyCompletionItem extends CompletionItem {
|
|||
if (this.insertText[0] === '[') { // o.x -> o['x']
|
||||
this.filterText = '.' + this.label;
|
||||
}
|
||||
|
||||
// Make sure we only replace a single line at most
|
||||
if (!this.range.isSingleLine) {
|
||||
this.range = new Range(this.range.start.line, this.range.start.character, this.range.start.line, line.length);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -69,6 +75,7 @@ class MyCompletionItem extends CompletionItem {
|
|||
this.filterText = this.label;
|
||||
this.label += '?';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public resolve(): void {
|
||||
|
@ -249,6 +256,7 @@ export default class TypeScriptCompletionItemProvider implements CompletionItemP
|
|||
return [];
|
||||
}
|
||||
|
||||
const line = document.lineAt(position.line);
|
||||
const config = this.getConfiguration(document.uri);
|
||||
|
||||
if (context.triggerCharacter === '"' || context.triggerCharacter === '\'') {
|
||||
|
@ -257,8 +265,8 @@ export default class TypeScriptCompletionItemProvider implements CompletionItemP
|
|||
}
|
||||
|
||||
// make sure we are in something that looks like the start of an import
|
||||
const line = document.lineAt(position.line).text.slice(0, position.character);
|
||||
if (!line.match(/\b(from|import)\s*["']$/) && !line.match(/\b(import|require)\(['"]$/)) {
|
||||
const pre = line.text.slice(0, position.character);
|
||||
if (!pre.match(/\b(from|import)\s*["']$/) && !pre.match(/\b(import|require)\(['"]$/)) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
@ -269,16 +277,16 @@ export default class TypeScriptCompletionItemProvider implements CompletionItemP
|
|||
}
|
||||
|
||||
// make sure we are in something that looks like an import path
|
||||
const line = document.lineAt(position.line).text.slice(0, position.character);
|
||||
if (!line.match(/\b(from|import)\s*["'][^'"]*$/) && !line.match(/\b(import|require)\(['"][^'"]*$/)) {
|
||||
const pre = line.text.slice(0, position.character);
|
||||
if (!pre.match(/\b(from|import)\s*["'][^'"]*$/) && !pre.match(/\b(import|require)\(['"][^'"]*$/)) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
if (context.triggerCharacter === '@') {
|
||||
// make sure we are in something that looks like the start of a jsdoc comment
|
||||
const line = document.lineAt(position.line).text.slice(0, position.character);
|
||||
if (!line.match(/^\s*\*[ ]?@/) && !line.match(/\/\*\*+[ ]?@/)) {
|
||||
const pre = line.text.slice(0, position.character);
|
||||
if (!pre.match(/^\s*\*[ ]?@/) && !pre.match(/\/\*\*+[ ]?@/)) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
@ -329,7 +337,7 @@ export default class TypeScriptCompletionItemProvider implements CompletionItemP
|
|||
if (!config.autoImportSuggestions && element.hasAction) {
|
||||
continue;
|
||||
}
|
||||
const item = new MyCompletionItem(position, document, element, enableDotCompletions, config.useCodeSnippetsOnMethodSuggest);
|
||||
const item = new MyCompletionItem(position, document, line.text, element, enableDotCompletions, config.useCodeSnippetsOnMethodSuggest);
|
||||
completionItems.push(item);
|
||||
}
|
||||
}
|
||||
|
@ -375,10 +383,34 @@ export default class TypeScriptCompletionItemProvider implements CompletionItemP
|
|||
}
|
||||
const detail = details[0];
|
||||
item.detail = detail.displayParts.length ? Previewer.plain(detail.displayParts) : undefined;
|
||||
item.documentation = this.getDocumentation(detail, item);
|
||||
|
||||
if (detail.codeActions && detail.codeActions.length) {
|
||||
item.command = {
|
||||
title: '',
|
||||
command: ApplyCompletionCodeActionCommand.ID,
|
||||
arguments: [filepath, detail.codeActions]
|
||||
};
|
||||
}
|
||||
|
||||
if (detail && item.useCodeSnippet) {
|
||||
const shouldCompleteFunction = await this.isValidFunctionCompletionContext(filepath, item.position);
|
||||
if (shouldCompleteFunction) {
|
||||
item.insertText = this.snippetForFunctionCall(item, detail);
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
private getDocumentation(
|
||||
detail: Proto.CompletionEntryDetails,
|
||||
item: MyCompletionItem
|
||||
): MarkdownString | undefined {
|
||||
const documentation = new MarkdownString();
|
||||
if (detail.source) {
|
||||
let importPath = `'${Previewer.plain(detail.source)}'`;
|
||||
|
||||
if (this.client.apiVersion.has260Features() && !this.client.apiVersion.has262Features()) {
|
||||
// Try to resolve the real import name that will be added
|
||||
if (detail.codeActions && detail.codeActions[0]) {
|
||||
|
@ -399,27 +431,9 @@ export default class TypeScriptCompletionItemProvider implements CompletionItemP
|
|||
}
|
||||
documentation.appendMarkdown('\n\n');
|
||||
}
|
||||
|
||||
Previewer.addMarkdownDocumentation(documentation, detail.documentation, detail.tags);
|
||||
item.documentation = documentation;
|
||||
|
||||
if (detail.codeActions && detail.codeActions.length) {
|
||||
item.command = {
|
||||
title: '',
|
||||
command: ApplyCompletionCodeActionCommand.ID,
|
||||
arguments: [filepath, detail.codeActions]
|
||||
};
|
||||
}
|
||||
|
||||
if (detail && item.useCodeSnippet) {
|
||||
const shouldCompleteFunction = await this.isValidFunctionCompletionContext(filepath, item.position);
|
||||
if (shouldCompleteFunction) {
|
||||
item.insertText = this.snippetForFunctionCall(item, detail);
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
||||
return item;
|
||||
return documentation.value.length ? documentation : undefined;
|
||||
}
|
||||
|
||||
private async isValidFunctionCompletionContext(filepath: string, position: Position): Promise<boolean> {
|
||||
|
|
|
@ -94,4 +94,8 @@ export default class DiagnosticsManager {
|
|||
const syntaxDiagnostics = this.syntaxDiagnostics.get(file);
|
||||
this.currentDiagnostics.set(file, semanticDiagnostics.concat(syntaxDiagnostics));
|
||||
}
|
||||
|
||||
public getDiagnostics(file: Uri): Diagnostic[] {
|
||||
return this.currentDiagnostics.get(file) || [];
|
||||
}
|
||||
}
|
|
@ -12,6 +12,7 @@ import FormattingConfigurationManager from './formattingConfigurationManager';
|
|||
import { getEditForCodeAction, applyCodeActionCommands } from '../utils/codeAction';
|
||||
import { Command, CommandManager } from '../utils/commandManager';
|
||||
import { createWorkspaceEditFromFileCodeEdits } from '../utils/workspaceEdit';
|
||||
import DiagnosticsManager from './diagnostics';
|
||||
|
||||
import * as nls from 'vscode-nls';
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
@ -31,6 +32,49 @@ class ApplyCodeActionCommand implements Command {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
class ApplyFixAllCodeAction implements Command {
|
||||
public static readonly ID = '_typescript.applyFixAllCodeAction';
|
||||
public readonly id = ApplyFixAllCodeAction.ID;
|
||||
|
||||
constructor(
|
||||
private readonly client: ITypeScriptServiceClient
|
||||
) { }
|
||||
|
||||
public async execute(
|
||||
file: string,
|
||||
tsAction: Proto.CodeFixAction,
|
||||
): Promise<void> {
|
||||
if (!tsAction.fixId) {
|
||||
return;
|
||||
}
|
||||
|
||||
const args: Proto.GetCombinedCodeFixRequestArgs = {
|
||||
scope: {
|
||||
type: 'file',
|
||||
args: { file }
|
||||
},
|
||||
fixId: tsAction.fixId
|
||||
};
|
||||
|
||||
try {
|
||||
const combinedCodeFixesResponse = await this.client.execute('getCombinedCodeFix', args);
|
||||
if (!combinedCodeFixesResponse.body) {
|
||||
return;
|
||||
}
|
||||
|
||||
const edit = createWorkspaceEditFromFileCodeEdits(this.client, combinedCodeFixesResponse.body.changes);
|
||||
await vscode.workspace.applyEdit(edit);
|
||||
|
||||
if (combinedCodeFixesResponse.command) {
|
||||
await vscode.commands.executeCommand(ApplyCodeActionCommand.ID, combinedCodeFixesResponse.command);
|
||||
}
|
||||
} catch {
|
||||
// noop
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class SupportedCodeActionProvider {
|
||||
private _supportedCodeActions?: Thenable<Set<number>>;
|
||||
|
||||
|
@ -61,9 +105,12 @@ export default class TypeScriptQuickFixProvider implements vscode.CodeActionProv
|
|||
constructor(
|
||||
private readonly client: ITypeScriptServiceClient,
|
||||
private readonly formattingConfigurationManager: FormattingConfigurationManager,
|
||||
commandManager: CommandManager
|
||||
commandManager: CommandManager,
|
||||
private readonly diagnosticsManager: DiagnosticsManager
|
||||
) {
|
||||
commandManager.register(new ApplyCodeActionCommand(client));
|
||||
commandManager.register(new ApplyFixAllCodeAction(client));
|
||||
|
||||
this.supportedCodeActionProvider = new SupportedCodeActionProvider(client);
|
||||
}
|
||||
|
||||
|
@ -91,12 +138,13 @@ export default class TypeScriptQuickFixProvider implements vscode.CodeActionProv
|
|||
|
||||
const results: vscode.CodeAction[] = [];
|
||||
for (const diagnostic of fixableDiagnostics) {
|
||||
results.push(...await this.getFixesForDiagnostic(file, diagnostic, token));
|
||||
results.push(...await this.getFixesForDiagnostic(document, file, diagnostic, token));
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
private async getFixesForDiagnostic(
|
||||
document: vscode.TextDocument,
|
||||
file: string,
|
||||
diagnostic: vscode.Diagnostic,
|
||||
token: vscode.CancellationToken
|
||||
|
@ -109,7 +157,7 @@ export default class TypeScriptQuickFixProvider implements vscode.CodeActionProv
|
|||
if (codeFixesResponse.body) {
|
||||
const results: vscode.CodeAction[] = [];
|
||||
for (const tsCodeFix of codeFixesResponse.body) {
|
||||
results.push(...await this.getAllFixesForTsCodeAction(file, diagnostic, tsCodeFix, token));
|
||||
results.push(...await this.getAllFixesForTsCodeAction(document, file, diagnostic, tsCodeFix));
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
@ -117,13 +165,13 @@ export default class TypeScriptQuickFixProvider implements vscode.CodeActionProv
|
|||
}
|
||||
|
||||
private async getAllFixesForTsCodeAction(
|
||||
document: vscode.TextDocument,
|
||||
file: string,
|
||||
diagnostic: vscode.Diagnostic,
|
||||
tsAction: Proto.CodeFixAction,
|
||||
token: vscode.CancellationToken
|
||||
tsAction: Proto.CodeFixAction
|
||||
): Promise<Iterable<vscode.CodeAction>> {
|
||||
const singleFix = this.getSingleFixForTsCodeAction(diagnostic, tsAction);
|
||||
const fixAll = await this.getFixAllForTsCodeAction(file, diagnostic, tsAction, token);
|
||||
const fixAll = await this.getFixAllForTsCodeAction(document, file, diagnostic, tsAction);
|
||||
return fixAll ? [singleFix, fixAll] : [singleFix];
|
||||
}
|
||||
|
||||
|
@ -145,44 +193,30 @@ export default class TypeScriptQuickFixProvider implements vscode.CodeActionProv
|
|||
}
|
||||
|
||||
private async getFixAllForTsCodeAction(
|
||||
document: vscode.TextDocument,
|
||||
file: string,
|
||||
diagnostic: vscode.Diagnostic,
|
||||
tsAction: Proto.CodeFixAction,
|
||||
token: vscode.CancellationToken
|
||||
): Promise<vscode.CodeAction | undefined> {
|
||||
if (!tsAction.fixId || !this.client.apiVersion.has270Features()) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const args: Proto.GetCombinedCodeFixRequestArgs = {
|
||||
scope: {
|
||||
type: 'file',
|
||||
args: { file }
|
||||
},
|
||||
fixId: tsAction.fixId
|
||||
};
|
||||
|
||||
try {
|
||||
const combinedCodeFixesResponse = await this.client.execute('getCombinedCodeFix', args, token);
|
||||
if (!combinedCodeFixesResponse.body) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const codeAction = new vscode.CodeAction(
|
||||
localize('fixAllInFileLabel', '{0} (Fix all in file)', tsAction.description),
|
||||
vscode.CodeActionKind.QuickFix);
|
||||
codeAction.edit = createWorkspaceEditFromFileCodeEdits(this.client, combinedCodeFixesResponse.body.changes);
|
||||
codeAction.diagnostics = [diagnostic];
|
||||
if (tsAction.commands) {
|
||||
codeAction.command = {
|
||||
command: ApplyCodeActionCommand.ID,
|
||||
arguments: [tsAction],
|
||||
title: tsAction.description
|
||||
};
|
||||
}
|
||||
return codeAction;
|
||||
} catch {
|
||||
return undefined;
|
||||
// Make sure there are multiple diagnostics of the same type in the file
|
||||
if (!this.diagnosticsManager.getDiagnostics(document.uri).some(x => x.code === diagnostic.code && x !== diagnostic)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const action = new vscode.CodeAction(
|
||||
localize('fixAllInFileLabel', '{0} (Fix all in file)', tsAction.description),
|
||||
vscode.CodeActionKind.QuickFix);
|
||||
action.diagnostics = [diagnostic];
|
||||
|
||||
action.command = {
|
||||
command: ApplyFixAllCodeAction.ID,
|
||||
arguments: [file, tsAction],
|
||||
title: ''
|
||||
};
|
||||
return action;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -123,7 +123,7 @@ export default class LanguageProvider {
|
|||
this.disposables.push(languages.registerDocumentSymbolProvider(selector, new (await import('./features/documentSymbolProvider')).default(client)));
|
||||
this.disposables.push(languages.registerSignatureHelpProvider(selector, new (await import('./features/signatureHelpProvider')).default(client), '(', ','));
|
||||
this.disposables.push(languages.registerRenameProvider(selector, new (await import('./features/renameProvider')).default(client)));
|
||||
this.disposables.push(languages.registerCodeActionsProvider(selector, new (await import('./features/quickFixProvider')).default(client, this.formattingOptionsManager, commandManager)));
|
||||
this.disposables.push(languages.registerCodeActionsProvider(selector, new (await import('./features/quickFixProvider')).default(client, this.formattingOptionsManager, commandManager, this.diagnosticsManager)));
|
||||
this.disposables.push(languages.registerCodeActionsProvider(selector, new (await import('./features/refactorProvider')).default(client, this.formattingOptionsManager, commandManager)));
|
||||
this.registerVersionDependentProviders();
|
||||
|
||||
|
|
|
@ -354,8 +354,9 @@ export default class TypeScriptServiceClient implements ITypeScriptServiceClient
|
|||
return this.servicePromise = new Promise<ForkedTsServerProcess>(async (resolve, reject) => {
|
||||
try {
|
||||
const tsServerForkArgs = await this.getTsServerArgs(currentVersion);
|
||||
const debugPort = this.getDebugPort();
|
||||
const tsServerForkOptions: electron.IForkOptions = {
|
||||
execArgv: [] // [`--debug-brk=5859`]
|
||||
execArgv: debugPort ? [`--inspect=${debugPort}`] : [] // [`--debug-brk=5859`]
|
||||
};
|
||||
electron.fork(currentVersion.tsServerPath, tsServerForkArgs, tsServerForkOptions, this.logger, (err: any, childProcess: cp.ChildProcess | null) => {
|
||||
if (err || !childProcess) {
|
||||
|
@ -942,6 +943,18 @@ export default class TypeScriptServiceClient implements ITypeScriptServiceClient
|
|||
return args;
|
||||
}
|
||||
|
||||
|
||||
private getDebugPort(): number | undefined {
|
||||
const value = process.env['TSS_DEBUG'];
|
||||
if (value) {
|
||||
const port = parseInt(value);
|
||||
if (!isNaN(port)) {
|
||||
return port;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
private resetClientVersion() {
|
||||
this._apiVersion = API.defaultVersion;
|
||||
this._tsserverVersion = undefined;
|
||||
|
|
|
@ -10,25 +10,42 @@
|
|||
version "5.4.0"
|
||||
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-5.4.0.tgz#f3658535af7f1f502acd6da7daf405ffeb1f7ee4"
|
||||
|
||||
applicationinsights@0.18.0:
|
||||
version "0.18.0"
|
||||
resolved "https://registry.yarnpkg.com/applicationinsights/-/applicationinsights-0.18.0.tgz#162ebb48a383408bc4de44db32b417307f45bbc1"
|
||||
applicationinsights@1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/applicationinsights/-/applicationinsights-1.0.1.tgz#53446b830fe8d5d619eee2a278b31d3d25030927"
|
||||
dependencies:
|
||||
diagnostic-channel "0.2.0"
|
||||
diagnostic-channel-publishers "0.2.1"
|
||||
zone.js "0.7.6"
|
||||
|
||||
diagnostic-channel-publishers@0.2.1:
|
||||
version "0.2.1"
|
||||
resolved "https://registry.yarnpkg.com/diagnostic-channel-publishers/-/diagnostic-channel-publishers-0.2.1.tgz#8e2d607a8b6d79fe880b548bc58cc6beb288c4f3"
|
||||
|
||||
diagnostic-channel@0.2.0:
|
||||
version "0.2.0"
|
||||
resolved "https://registry.yarnpkg.com/diagnostic-channel/-/diagnostic-channel-0.2.0.tgz#cc99af9612c23fb1fff13612c72f2cbfaa8d5a17"
|
||||
dependencies:
|
||||
semver "^5.3.0"
|
||||
|
||||
semver@4.3.6:
|
||||
version "4.3.6"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-4.3.6.tgz#300bc6e0e86374f7ba61068b5b1ecd57fc6532da"
|
||||
|
||||
vscode-extension-telemetry@^0.0.8:
|
||||
version "0.0.8"
|
||||
resolved "https://registry.yarnpkg.com/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.8.tgz#2261bff986b6690a6f1f746a45ac5bd1f85d29e0"
|
||||
semver@^5.3.0:
|
||||
version "5.5.0"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab"
|
||||
|
||||
vscode-extension-telemetry@^0.0.11:
|
||||
version "0.0.11"
|
||||
resolved "https://registry.yarnpkg.com/vscode-extension-telemetry/-/vscode-extension-telemetry-0.0.11.tgz#f2dde487f01d2b079f55ab47a0247f5a772c4e06"
|
||||
dependencies:
|
||||
applicationinsights "0.18.0"
|
||||
winreg "1.2.3"
|
||||
applicationinsights "1.0.1"
|
||||
|
||||
vscode-nls@^3.1.2:
|
||||
version "3.1.2"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.1.2.tgz#c1b63f4338ac49c852267633dd99717916424a74"
|
||||
vscode-nls@^3.2.1:
|
||||
version "3.2.1"
|
||||
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-3.2.1.tgz#b1f3e04e8a94a715d5a7bcbc8339c51e6d74ca51"
|
||||
|
||||
winreg@1.2.3:
|
||||
version "1.2.3"
|
||||
resolved "https://registry.yarnpkg.com/winreg/-/winreg-1.2.3.tgz#93ad116b2696da87d58f7265a8fcea5254a965d5"
|
||||
zone.js@0.7.6:
|
||||
version "0.7.6"
|
||||
resolved "https://registry.yarnpkg.com/zone.js/-/zone.js-0.7.6.tgz#fbbc39d3e0261d0986f1ba06306eb3aeb0d22009"
|
||||
|
|
|
@ -523,42 +523,42 @@ suite('workspace-namespace', () => {
|
|||
});
|
||||
|
||||
|
||||
test('applyEdit should fail when editing deleted resource', async () => {
|
||||
const resource = await createRandomFile();
|
||||
// test('applyEdit should fail when editing deleted resource', async () => {
|
||||
// const resource = await createRandomFile();
|
||||
|
||||
const edit = new vscode.WorkspaceEdit();
|
||||
edit.deleteResource(resource);
|
||||
try {
|
||||
edit.insert(resource, new vscode.Position(0, 0), '');
|
||||
assert.fail(false, 'Should disallow edit of deleted resource');
|
||||
} catch {
|
||||
// noop
|
||||
}
|
||||
});
|
||||
// const edit = new vscode.WorkspaceEdit();
|
||||
// edit.deleteResource(resource);
|
||||
// try {
|
||||
// edit.insert(resource, new vscode.Position(0, 0), '');
|
||||
// assert.fail(false, 'Should disallow edit of deleted resource');
|
||||
// } catch {
|
||||
// // noop
|
||||
// }
|
||||
// });
|
||||
|
||||
test('applyEdit should fail when renaming deleted resource', async () => {
|
||||
const resource = await createRandomFile();
|
||||
// test('applyEdit should fail when renaming deleted resource', async () => {
|
||||
// const resource = await createRandomFile();
|
||||
|
||||
const edit = new vscode.WorkspaceEdit();
|
||||
edit.deleteResource(resource);
|
||||
try {
|
||||
edit.renameResource(resource, resource);
|
||||
assert.fail(false, 'Should disallow rename of deleted resource');
|
||||
} catch {
|
||||
// noop
|
||||
}
|
||||
});
|
||||
// const edit = new vscode.WorkspaceEdit();
|
||||
// edit.deleteResource(resource);
|
||||
// try {
|
||||
// edit.renameResource(resource, resource);
|
||||
// assert.fail(false, 'Should disallow rename of deleted resource');
|
||||
// } catch {
|
||||
// // noop
|
||||
// }
|
||||
// });
|
||||
|
||||
test('applyEdit should fail when editing renamed from resource', async () => {
|
||||
const resource = await createRandomFile();
|
||||
const newResource = vscode.Uri.parse(resource.fsPath + '.1');
|
||||
const edit = new vscode.WorkspaceEdit();
|
||||
edit.renameResource(resource, newResource);
|
||||
try {
|
||||
edit.insert(resource, new vscode.Position(0, 0), '');
|
||||
assert.fail(false, 'Should disallow editing renamed file');
|
||||
} catch {
|
||||
// noop
|
||||
}
|
||||
});
|
||||
// test('applyEdit should fail when editing renamed from resource', async () => {
|
||||
// const resource = await createRandomFile();
|
||||
// const newResource = vscode.Uri.parse(resource.fsPath + '.1');
|
||||
// const edit = new vscode.WorkspaceEdit();
|
||||
// edit.renameResource(resource, newResource);
|
||||
// try {
|
||||
// edit.insert(resource, new vscode.Position(0, 0), '');
|
||||
// assert.fail(false, 'Should disallow editing renamed file');
|
||||
// } catch {
|
||||
// // noop
|
||||
// }
|
||||
// });
|
||||
});
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
# yarn lockfile v1
|
||||
|
||||
|
||||
typescript@2.7.1-insiders.20180127:
|
||||
version "2.7.1-insiders.20180127"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.7.1-insiders.20180127.tgz#db1f0d903e86c0867ec5c6e04ef10ded9ad9399b"
|
||||
typescript@2.7.1:
|
||||
version "2.7.1"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.7.1.tgz#bb3682c2c791ac90e7c6210b26478a8da085c359"
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"": [
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved.",
|
||||
"Licensed under the MIT License. See License.txt in the project root for license information.",
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Do not edit this file. It is machine generated."
|
||||
],
|
||||
"cssserver.name": "CSS 语言服务器",
|
||||
"folding.start": "折叠区域开始",
|
||||
"folding.end": "折叠区域结束"
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"": [
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved.",
|
||||
"Licensed under the MIT License. See License.txt in the project root for license information.",
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Do not edit this file. It is machine generated."
|
||||
],
|
||||
"missOrInvalid": "凭据丢失或无效。"
|
||||
}
|
|
@ -1,9 +1,11 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"": [
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved.",
|
||||
"Licensed under the MIT License. See License.txt in the project root for license information.",
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Do not edit this file. It is machine generated."
|
||||
],
|
||||
"yes": "是",
|
||||
"read more": "了解详细信息",
|
||||
"no": "否",
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"": [
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved.",
|
||||
"Licensed under the MIT License. See License.txt in the project root for license information.",
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Do not edit this file. It is machine generated."
|
||||
],
|
||||
"tag at": "{0} 处的 Tag",
|
||||
"remote branch at": "{0} 处的远程分支",
|
||||
"create branch": "$(plus) 创建新分支",
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"": [
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved.",
|
||||
"Licensed under the MIT License. See License.txt in the project root for license information.",
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Do not edit this file. It is machine generated."
|
||||
],
|
||||
"looking": "在 {0} 查找 Git 中",
|
||||
"using git": "使用 {1} 中的 Git {0}",
|
||||
"downloadgit": "下载 Git",
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"": [
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved.",
|
||||
"Licensed under the MIT License. See License.txt in the project root for license information.",
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Do not edit this file. It is machine generated."
|
||||
],
|
||||
"no repositories": "没有可用存储库",
|
||||
"pick repo": "选择存储库"
|
||||
}
|
|
@ -1,9 +1,11 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"": [
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved.",
|
||||
"Licensed under the MIT License. See License.txt in the project root for license information.",
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Do not edit this file. It is machine generated."
|
||||
],
|
||||
"open": "打开",
|
||||
"index modified": "已修改索引",
|
||||
"modified": "已修改",
|
||||
|
@ -21,11 +23,13 @@
|
|||
"deleted by us": "已被我们删除",
|
||||
"both added": "两者均已添加",
|
||||
"both modified": "二者均已修改",
|
||||
"commitMessage": "消息(按 {0} 提交)",
|
||||
"commitMessage": "消息 (按 {0} 提交)",
|
||||
"commit": "提交",
|
||||
"merge changes": "合并更改",
|
||||
"staged changes": "暂存的更改",
|
||||
"changes": "更改",
|
||||
"commitMessageCountdown": "当前行剩余 {0} 个字符",
|
||||
"commitMessageWarning": "当前行比 {1} 超出 {0} 个字符",
|
||||
"ok": "确定",
|
||||
"neveragain": "不再显示",
|
||||
"huge": "Git 存储库“{0}”中存在大量活动更改,将仅启用部分 Git 功能。"
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"": [
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved.",
|
||||
"Licensed under the MIT License. See License.txt in the project root for license information.",
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Do not edit this file. It is machine generated."
|
||||
],
|
||||
"checkout": "签出...",
|
||||
"sync changes": "同步更改",
|
||||
"publish changes": "发布更改",
|
||||
|
|
|
@ -71,6 +71,8 @@
|
|||
"config.enableCommitSigning": "启用使用 GPG 签名的提交",
|
||||
"config.discardAllScope": "控制运行“放弃所有更改”命令时放弃的更改类型。\"all\" 放弃所有更改。\"tracked\" 只放弃跟踪的文件。\"prompt\" 表示在每次运行此操作时显示提示对话框。",
|
||||
"config.decorations.enabled": "控制 Git 是否向资源管理器和“打开的编辑器”视图添加颜色和小标。",
|
||||
"config.promptToSaveFilesBeforeCommit": "控制 Git 是否在提交之前检查未保存的文件。",
|
||||
"config.showInlineOpenFileAction": "控制是否在 Git 更改视图中显示内联“打开文件”操作。",
|
||||
"colors.modified": "已修改资源的颜色。",
|
||||
"colors.deleted": "已删除资源的颜色。",
|
||||
"colors.untracked": "未跟踪资源的颜色。",
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"": [
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved.",
|
||||
"Licensed under the MIT License. See License.txt in the project root for license information.",
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Do not edit this file. It is machine generated."
|
||||
],
|
||||
"execFailed": "在文件夹 {0} 中自动检测 Grunt 失败,错误: {1}"
|
||||
}
|
|
@ -1,8 +1,10 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"": [
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved.",
|
||||
"Licensed under the MIT License. See License.txt in the project root for license information.",
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Do not edit this file. It is machine generated."
|
||||
],
|
||||
"execFailed": "在文件夹 {0} 中自动检测 gulp 失败,错误: {1}"
|
||||
}
|
|
@ -1,9 +1,11 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"": [
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved.",
|
||||
"Licensed under the MIT License. See License.txt in the project root for license information.",
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Do not edit this file. It is machine generated."
|
||||
],
|
||||
"htmlserver.name": "HTML 语言服务器",
|
||||
"folding.start": "折叠区域开始",
|
||||
"folding.end": "折叠区域结束"
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"": [
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved.",
|
||||
"Licensed under the MIT License. See License.txt in the project root for license information.",
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Do not edit this file. It is machine generated."
|
||||
],
|
||||
"execFailed": "在文件夹 {0} 中自动检测 Jake 失败,错误: {1}"
|
||||
}
|
|
@ -1,8 +1,10 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"": [
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved.",
|
||||
"Licensed under the MIT License. See License.txt in the project root for license information.",
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Do not edit this file. It is machine generated."
|
||||
],
|
||||
"jsonserver.name": "JSON 语言服务器"
|
||||
}
|
|
@ -1,9 +1,11 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"": [
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved.",
|
||||
"Licensed under the MIT License. See License.txt in the project root for license information.",
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Do not edit this file. It is machine generated."
|
||||
],
|
||||
"previewTitle": "预览 {0}",
|
||||
"onPreviewStyleLoadError": "无法加载“markdown.styles”:{0}"
|
||||
}
|
|
@ -1,9 +1,11 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"": [
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved.",
|
||||
"Licensed under the MIT License. See License.txt in the project root for license information.",
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Do not edit this file. It is machine generated."
|
||||
],
|
||||
"preview.securityMessage.text": "已禁用此文档中的部分内容",
|
||||
"preview.securityMessage.title": "已禁用此 Markdown 预览中的可能不安全的内容。更改 Markdown 预览安全设置以允许不安全内容或启用脚本。",
|
||||
"preview.securityMessage.label": "已禁用内容安全警告"
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"": [
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved.",
|
||||
"Licensed under the MIT License. See License.txt in the project root for license information.",
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Do not edit this file. It is machine generated."
|
||||
],
|
||||
"strict.title": "严格",
|
||||
"strict.description": "仅载入安全内容",
|
||||
"insecureContent.title": "允许不安全内容",
|
||||
|
@ -13,6 +15,5 @@
|
|||
"moreInfo.title": "详细信息",
|
||||
"enableSecurityWarning.title": "在此工作区中启用预览安全警告",
|
||||
"disableSecurityWarning.title": "在此工作区中取消预览安全警告",
|
||||
"toggleSecurityWarning.description": "不影响内容安全等级",
|
||||
"preview.showPreviewSecuritySelector.title": "选择此工作区中 Markdown 预览的安全设置"
|
||||
}
|
|
@ -1,9 +1,11 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"": [
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved.",
|
||||
"Licensed under the MIT License. See License.txt in the project root for license information.",
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Do not edit this file. It is machine generated."
|
||||
],
|
||||
"acceptCurrentChange": "采用当前更改",
|
||||
"acceptIncomingChange": "采用传入的更改",
|
||||
"acceptBothChanges": "保留双方更改",
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"": [
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved.",
|
||||
"Licensed under the MIT License. See License.txt in the project root for license information.",
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Do not edit this file. It is machine generated."
|
||||
],
|
||||
"cursorNotInConflict": "编辑器光标不在合并冲突内",
|
||||
"compareChangesTitle": "{0}:当前更改 ⟷ 传入的更改",
|
||||
"cursorOnCommonAncestorsRange": "编辑器光标在共同来源块上,请将其移动至“当前”或“传入”区域中",
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"": [
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved.",
|
||||
"Licensed under the MIT License. See License.txt in the project root for license information.",
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Do not edit this file. It is machine generated."
|
||||
],
|
||||
"currentChange": "(当前更改)",
|
||||
"incomingChange": "(传入的更改)"
|
||||
}
|
|
@ -1,8 +1,10 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"": [
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved.",
|
||||
"Licensed under the MIT License. See License.txt in the project root for license information.",
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Do not edit this file. It is machine generated."
|
||||
],
|
||||
"npm.parseError": "Npm 任务检测: 无法分析文件 {0}"
|
||||
}
|
|
@ -1,11 +1,13 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
// Do not edit this file. It is machine generated.
|
||||
{
|
||||
"": [
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved.",
|
||||
"Licensed under the MIT License. See License.txt in the project root for license information.",
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Do not edit this file. It is machine generated."
|
||||
],
|
||||
"php.useExecutablePath": "是否允许执行 {0} (定义为工作区设置)以进行 PHP 文件的 lint 操作?",
|
||||
"php.yes": "允许",
|
||||
"php.yes": "Allow",
|
||||
"php.no": "不允许",
|
||||
"wrongExecutable": "无法验证,因为 {0} 不是有效的 PHP 可执行文件。请使用设置 \"php.validate.executablePath\" 配置 PHP 可执行文件。",
|
||||
"noExecutable": "无法验证,因为未设置任何 PHP 可执行文件。请使用设置 \"php.validate.executablePath\" 配置 PHP 可执行文件。",
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"": [
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved.",
|
||||
"Licensed under the MIT License. See License.txt in the project root for license information.",
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Do not edit this file. It is machine generated."
|
||||
],
|
||||
"previewOnGitHub": "在 GitHub 中预览",
|
||||
"similarIssues": "类似的问题",
|
||||
"noResults": "未找到结果",
|
||||
"stepsToReproduce": "重现步骤",
|
||||
"bugDescription": "您是怎么遇到这个问题的? 您需要执行哪些步骤来稳定重现此问题? 您期望发生什么,实际上发生了什么?",
|
||||
"performanceIssueDesciption": "这个性能问题是在什么时候发生的? 比如,它在启动时还是在一系列特定的操作之后发生的? 您提供的任何细节都能帮助我们进行调查。",
|
||||
"description": "描述",
|
||||
"disabledExtensions": "扩展已禁用"
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
"": [
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved.",
|
||||
"Licensed under the MIT License. See License.txt in the project root for license information.",
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Do not edit this file. It is machine generated."
|
||||
],
|
||||
"completeInEnglish": "请使用英文填写表单。",
|
||||
"issueTypeLabel": "我想提交",
|
||||
"bugReporter": "问题报告",
|
||||
"performanceIssue": "性能问题",
|
||||
"featureRequest": "功能请求",
|
||||
"issueTitleLabel": "标题",
|
||||
"issueTitleRequired": "请输入标题。",
|
||||
"vscodeVersion": "VS Code 版本",
|
||||
"osVersion": "操作系统版本",
|
||||
"systemInfo": "我的系统信息",
|
||||
"sendData": "发送我的数据",
|
||||
"processes": "当前运行的进程",
|
||||
"workspaceStats": "我的工作区数据",
|
||||
"extensions": "我的扩展",
|
||||
"disableExtensions": "禁用所有扩展并重新加载窗口",
|
||||
"showRunningExtensions": "查看所有运行中的扩展",
|
||||
"githubMarkdown": "我们支持 GitHub 版 Markdown。您将能在 GitHub 上预览时编辑问题并添加截图。",
|
||||
"issueDescriptionRequired": "请输入说明。",
|
||||
"loadingData": "正在加载数据..."
|
||||
}
|
21
i18n/chs/src/vs/code/electron-main/logUploader.i18n.json
Normal file
21
i18n/chs/src/vs/code/electron-main/logUploader.i18n.json
Normal file
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"": [
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved.",
|
||||
"Licensed under the MIT License. See License.txt in the project root for license information.",
|
||||
"--------------------------------------------------------------------------------------------",
|
||||
"Do not edit this file. It is machine generated."
|
||||
],
|
||||
"invalidEndpoint": "日志上传端点无效",
|
||||
"beginUploading": "正在上传...",
|
||||
"didUploadLogs": "上传成功! 日志文件 ID: {0}",
|
||||
"userDeniedUpload": "已取消上传",
|
||||
"logUploadPromptHeader": "是否将会话日志上传到安全端点?",
|
||||
"logUploadPromptBody": "请在此处审阅您的日志文件:“{0}”",
|
||||
"logUploadPromptBodyDetails": "日志可能包含个人信息,例如完整路径和文件内容。",
|
||||
"logUploadPromptKey": "我已经审阅了日志 (输入 \"y\" 确认上传)",
|
||||
"postError": "上传日志时出错: {0}",
|
||||
"responseError": "上传日志时出错。收到 {0} — {1}",
|
||||
"parseError": "分析响应时出错",
|
||||
"zipError": "压缩日志时出错: {0}"
|
||||
}
|
|
@ -90,6 +90,7 @@
|
|||
"miMarker": "问题(&&P)",
|
||||
"miAdditionalViews": "其他视图(&&V)",
|
||||
"miCommandPalette": "命令面板(&&C)...",
|
||||
"miOpenView": "打开视图(&&O)...",
|
||||
"miToggleFullScreen": "切换全屏(&&F)",
|
||||
"miToggleZenMode": "切换 Zen 模式",
|
||||
"miToggleMenuBar": "切换菜单栏(&&B)",
|
||||
|
@ -180,12 +181,13 @@
|
|||
"miConfigureTask": "配置任务(&&C)...",
|
||||
"miConfigureBuildTask": "配置默认生成任务(&&F)...",
|
||||
"accessibilityOptionsWindowTitle": "辅助功能选项",
|
||||
"miRestartToUpdate": "重启以更新...",
|
||||
"miCheckForUpdates": "检查更新...",
|
||||
"miCheckingForUpdates": "正在检查更新...",
|
||||
"miDownloadUpdate": "下载可用更新",
|
||||
"miDownloadingUpdate": "正在下载更新...",
|
||||
"miInstallUpdate": "安装更新...",
|
||||
"miInstallingUpdate": "正在安装更新...",
|
||||
"miCheckForUpdates": "检查更新...",
|
||||
"miRestartToUpdate": "重启以更新...",
|
||||
"aboutDetail": "版本 {0}\n提交 {1}\n日期 {2}\nShell {3}\n渲染器 {4}\nNode {5}\n架构 {6}",
|
||||
"okButton": "确定",
|
||||
"copy": "复制(&&C)"
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue